I have a bash script encoded in utf8 .
Within the script i use sed command using §
as a separator .
Now when i run execute this script sed
complains about the separator.
If i use normal char as a separator for ex @
then everything works.
I have viewed the script in putty[set utf8 in putty] and the character appears fine.
Also Linux default char set from locale
command shows
LC_CSET=en_US.UTF-8
What could have gone wrong?
Earlier i used to have windows-1252 encoding for the shell scripts and this used to work.
Best Answer
Probably your version of
sed
does not support multibyte separator characters. If you look at the way§
is encoded in the two character sets, you'll see the difference:Various versions of
sed
will give you more or less helpful messages. On my OS X 10.6 system, I get the somewhat cryptic:The version of
sed
that Ubuntu 10.04 LTS uses is more helpful: