How do I delete a line only if it is at a specified line number and it matches the pattern?
For example:
- I want to delete (
d); - the third line (
3); - if it's blank (
^$);
The following syntax:
cat file | sed '3 /^$/d'
Returns the following error:
sed: -e expression #1, char 3: unknown command: `/'