regex - sed formatting double quotes single quotes -


i'm using sed replace word in text.xml.

the text.xml looks this:

some line <state name='generate'>     notify </state> line 

i'm trying replace word 'notify' caller' command have far is:

sed -i "/<state name=\'generate\'>/,/<\/state>/s/notify/caller/" ./test.xml 

i giving sed range of lines between , . between lines word 'notify' replacing caller.

i'm unsure if quoting problem. insight appreciated, thanks.

edit: got work removing escape characters around generate.

sed -i "/<state name='generate'>/,/<\/state>/s/notify/caller/" ./test.xml 

does know reason behind it?

it seems don't need escape single quotes when using double quotes sandwich entire expression... – siddhartha

i got work removing escape characters around generate. – user2661842


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -