I want to get all lines of a textfile following a certain grep match until I hit another, different grep match. But if there is another match after that, I want to show lines again. Example: My textfile looks similar to:
Pattern_A line1 line2 Pattern_B line3 line4 Pattern_A line5 line6 Pattern_B line7
Now I need a command, that outputs:
Pattern_A line1 line2 Pattern_A line5 line6
Thank you in advance!