I've seen many topics about escaping and replacing a special character in SED, but none of them helped me.
I have this sed command I need to use on a file:
sed -i "s/This[^\|]\+/& (cool) /g" "file.txt"
For a reason I don't understand, it applies to this test case:
This is my funny 🎺 char and this | char is the char after which i want to stop my job.
... and transforms it to :
This is my funny 🎠(cool) ڠchar and this | char is the char after which i want to stop my job.
... instead of :
This is my funny 🎺 char and this (cool) | char is the char after which i want to stop my job.
Can anybody tell me how to handle this kind of case ?
Note : the file is UTF-8 encoded, I use Cygwin that is UTF-8 encoded and my SED command is in a ".sh" file that is UTF-8 encoded too.