Sed alternate delimiters
Sed alternate delimiters
Sometimes when trying to replace text using the sed command line tool you will tun into the issue in which your text has the forward slash characters which can be a bit of a headache because thats what sed uses to delimit strings. Thankfully the delimiter is pretty flexible. I like to use the pipe "|" symbol, but pretty much any other symbol will work such as the tilde "`" or the colon ":" ex:
sed -i 's|TEXT|REPLACEMENT_TEXT|g' test.txt
sed -i 's:TEXT:REPLACEMENT_TEXT:g' test.txt
sed -i 's`TEXT`REPLACEMENT_TEXT`g' test.txt