Can I use sed
to check the first line of some command\'s output (to stdout) and delete this very first line if it matches a certain pattern?
Say, the co
This is what you want:
$ sed '1{/"GH"/!d}' file
sed '1{/<pattern>/{/GH/!d}}' input
The error in your expression can be fixed like this:
sed '1{/<pattern>/d}' input
You want to reference the 1st line, then say delete:
$ sed '1 d' file
No need for any pattern if you know which line you want to delete.
With a pattern, use this syntax:
$ sed '0,/pattern/ d' file
This might work for you:
sed -e '1!b' -e '/GH/!d' file