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

Popular posts from this blog

matlab - Deleting rows with specific rules -

image - ClassNotFoundException when add a prebuilt apk into system.img in android -