You're replying to a comment by Bhupender.

Bhupender Permalink
October 28, 2011, 07:50

Hi Peter,
Could you please tell some short command to delete lines from a file between two specific patterns/strings.
I am using the command : cat File | sed '/ABC/,/DEF/ d'
By using above command I am able to delete all the lines between ABC and DEF. But at the same time the first line containing ABC and last lilne containg DEF also get deleted, which i dont want.
Kindly help.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "cdrom_257": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.