I'm familiar with using sed to grab lines between two patterns. For example:
$ cat file
A
PATTERN1
B
PATTERN2
C
$ sed -n '/PATTERN1/,/PATTERN2/p' file
PATTERN1
B
PATTERN2
What I'd like to do, however, is generate this output:
PATTERN1
B
PATTERN2
C
I've come across the {n;p} syntax (example), but I can't seem to shoehorn this into the type of pattern matching I'm doing in this example problem.