I am trying to use sed in order to replace
blah.org$VARIABLE to blah.org/$VARIABLE
I can do it without using a variable with:
sed 's,orgSOMETHING,org/SOMETHING/,g' < file
but when I try
sed 's,org$VARIABLE,org/$VARIABLE/,g' < file
it doesn't work...sorry for dumb question
答案 0 :(得分:1)
You need to escape the dollar symbol.
sed 's,org\$VARIABLE,org/\$VARIABLE/,g' file
If $VARIABLE
is actually a variable name then use double quotes.
sed "s,org$VARIABLE,org/$VARIABLE/,g" file