This question already has an answer here:
- How can I replace a string in a file(s)? 8 answers
How do I delete a line only if it is at a specified line number and it matches the pattern?
- I want to delete (
- the third line (
- if it's blank (
The following syntax:
cat file | sed '3 /^$/d'
Returns the following error:
sed: -e expression #1, char 3: unknown command: `/'