ionral
1
I'm looking for a way to replace a line with two ... give an example
grep -in "stop)" /etc/init.d/drbd
I issue the following output:
178: stop)
now I need to replace this line with two.
stop)
vgchange -an
sed I did not understand how, or if you can do, although I think so ...
enlighten me know about it?
thanks
It's not tested...but could give a try..
sed 's/stop\)/&\nvgchange -an/' /etc/init.d/drbd > outfile
ionral
3
the brackets should not be commented out, so I completed my purpose
sed -i.bak -e 's/stop)/&\n\tvgchange -an/' /etc/init.d/drbd
it's the output
stop)
vgchange -an
thanks thanks again!!!!!!