This question already has an answer here:
sed -e '/pattern1/,/pattern2/!d' file.org
How can I match the first occurrence of the lines between pattern1 and pattern2, but not the rest?
pattern1 aaaa pattern2 pattern1 bbb pattern
Alternatives solutions (using
awk or whatever) are welcomed.