Created
April 26, 2021 02:53
-
-
Save BenSYZ/a643b3ce05d65cfe8e6437f38bf59ae5 to your computer and use it in GitHub Desktop.
awk grep except the first line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
var="$*" | |
lsof -i|awk -v pattern="$var" ' | |
NR==1 {print $0}; | |
NR>=1 && $0 ~ pattern {print $0}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment