Can I use sedto check the first line of the command output (on stdout) and delete this very first line if it matches a specific pattern?
Let's say the command output looks something like this:
"AB"
"CD"
"E"
"F"
I want him to become:
"CD"
"E"
"F"
But when the first line "GH", I do not want to delete the line.
I tried this, but it does not work:
<some_command> |sed '1/<pattern>/d'
About me said:
sed: 0602-403 1/<pattern>/d is not a recognized function.
I just want to use sed to process the first line, leaving the other lines intact.
What is the correct syntax here?
source
share