Quote:
Originally Posted by ghostdog74
Code:
awk '/a/{getline;next}1' file
|
The problem with this sort of approach is that it removes two lines without applying the pattern match to
next itself. This might cause trouble when you have an even number of consecutive lines containing the character ‘a’ in your file.
For example, if
file is the following:
Your filter will result in the following output:
Code:
$ awk '/a/{getline;next}1' file
c
d
But the desired output would be:
It is unclear (to me anyway) if the OP is affected by this problem.