Contents
How do you change the special character in sed?
Replace special characters with sed
- _ is underscore, – is dash. Which of these do you want to replace? – …
- You need to quote the sed argument that contains the subsitution, because it includes special shell characters. – Barmar Apr 17 ’15 at 21:23.
- And the command to do string substitution is s/from/to/ .
How do you escape special characters in sed?
Sed needs many characters to be escaped to get their special meaning. For example, if you escape a digit in the replacement string, it will turn in to a backreference. Remember, if you use a character other than / as delimiter, you need replace the slash in the expressions above wih the character you are using.