Delete the Lines Between Two Matching Lines (Inclusive)
sed '/PATTERN1/,/PATTERN2/d' FILE...
For each file in FILE... start at the first line of the file and do the following:
If the line doesn’t match PATTERN1, output the line, then go to step 1.
Ignore the line matching PATTERN1, and move to the next line.
If the line doesn’t match PATTERN2, ignore the line, then go to step 3.
Ignore the line matching PATTERN2, and move to the next line.
Go back to step 1.
Pros: Handles multiple files.
Cons: Assumes matching pairs: If a file ever has a line matching PATTERN1 with no subsequent line matching PATTERN2, all lines after and including the one matching PATTERN1 are removed. Assumes no nesting of pairs.