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

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

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -