I can do this for example
sed 's/\>\</\>\
</g'
To replace ><
with
>
<
However, say I want a variable, like this:
sed 's/\>\</\>\
<$1/g'
It will interpret it as literally $1
. To fix this, I use "
instead of '
.
Like this:
sed "s/\>\</\>\
<$1/g"
But it doesn't understand the newline when I use "
. \n
does not work either.
\n
?\n
. Same thing with-e
if that would change anything.sed
will only get the pattern after the shell does quote removal, etc., so if quoting causes a problem, the shell is probably the culprit.'s/></>\[enter]<'"$SHELL/g"
?