1

Commenting Multiple lines using Shell Script

view story
linux-howto

http://www.unix.com – I have an xml file which has following code : Code: <abc-ref>     <abc-name>abc.efg.hij.klm</abc-name>   </abc-ref> I want to comment this whole section out and I have written the following script : (where "hij" is unique string in the file) Code: TEMPFILE=replaceYY.tmp file=hello.xml sed -n '1h;1!H;${;g;s@<abc-ref.*hij*</abc-ref>@<!--Nothing-->@g;p;}' $file > $TEMPFILE mv $TEMPFILE $file But it is not working for me! Any help please.. (HowTos)