We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5edf9e commit e8c93f7Copy full SHA for e8c93f7
c
@@ -3,7 +3,7 @@
3
# Run command and put output to system clipper.
4
#
5
# @Usage
6
-# $ ./c echo "hello world!"
+# $ c echo "hello world!"
7
# $ echo "hello world!" | c
8
9
# @author Jerry Lee
tcp-connection-state-counter.sh
@@ -9,14 +9,14 @@
# @author @sunuslee
10
11
# On MacOS, netstat need to using -p tcp to get only tcp output.
12
-[ -n "$(uname | grep Darwin)" ] && option_for_mac="-ptcp"
+uname | grep Darwin -q && option_for_mac="-ptcp"
13
14
netstat -tna $option_for_mac | awk 'NR > 2 {
15
s[$NF]++
16
}
17
18
END {
19
for(v in s) {
20
- printf "%-12s%s\n", v, s[v]
+ printf "%-11s %s\n", v, s[v]
21
22
}' | sort -nr -k2,2
0 commit comments