I’m trying to remove all lines containing the copyright character (among other things, in a bash script), but it’s not working at all:
cat $srcdir/$txtfile |
sed "s/.*©.*/d" |
cat > $tgtdir/$txtfile
does nothing. However, running
echo blah © blah | sed "s/.*©.*//g"
in the terminal correctly yields
blah blah
I’m using SciTE set to UTF-8 encoding, so the first block of code above is exactly what I see in the editor. Any ideas on how I could represent it in an editor so sed will recognise it?
You might try using the octal representation of © which is
251That is on “oh” and not a zero.
To delete lines containing that character, use