Logical OR
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
How do I refine the following so that the p cannot be triggered twice even if both conditions are met in the same line? netstat -ntlp | sed -n -e '1,2p;/sshd/p' Or is there a more efficient formula which can be used? I'm aiming for the sed equivalent of an awk statement: netstat -ntlp | awk '/sshd/ || NR<=2' Regards, Lars