Delete the first line that matches a pattern
- by gioele
How can I use sed to delete only the first line that contains a certain pattern?
For example, I want to remove the first line matching FAA from this document:
1. foo bar quuz
2. foo FAA bar (this should go)
3. quuz quuz FAA (this should remain)
4. quuz FAA bar (this should also remain)
The result should be
1. foo bar quuz
3. quuz quuz FAA (this should remain)
4. quuz FAA bar (this should also remain)
A solution for POSIX sed would be greatly appreciated, GNU sed is OK.