I am trying to remove all instances of a pattern match from a file if it matches a pattern. If there is a match, the (complete) line with the matching pattern and the next line get removed.
The next line always appears after the line with the pattern match, but in addition it appears in other areas of the file.
I am using grep and it is deleting all occurrences of the next line in the file, as expected.
Is there a way I can remove that next line if and only if it is after the line with the pattern match?
awk
, but I'd like to make sure I'm clear on what you want before I post an answer. – HalosGhost Aug 26 '14 at 22:05