Escape characters in sed stream
by __John_L. from LinuxQuestions.org on (#5DS33)
I'm trying to use sed on the linux command line, and am running into an issue with special characters.
I'd like to replace "~" with "E;" in the target file (without quotations). So far, using this command:
sed {s/\~/\E\;/g}
on this data:
blah~blah
produces:
blah~#7E;blah
Close, but no cigar.
Thanks in advance for any insight you can provide.


I'd like to replace "~" with "E;" in the target file (without quotations). So far, using this command:
sed {s/\~/\E\;/g}
on this data:
blah~blah
produces:
blah~#7E;blah
Close, but no cigar.
Thanks in advance for any insight you can provide.