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

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -