linux - How to replace to apostrophe ' inside a file using SED -
i have file "test.txt" contain following
+foo+ +bar+
what want replace them into:
'foo' 'bar'
but why code doesn't work?
sed 's/\+/\'/' test.txt
what's right way it?
use "
instead. , add g
flag replace all.
sed "s/\+/\'/g" test.txt
Comments
Post a Comment