Skip to content

Commit e8c93f7

Browse files
committed
clean code
1 parent e5edf9e commit e8c93f7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Run command and put output to system clipper.
44
#
55
# @Usage
6-
# $ ./c echo "hello world!"
6+
# $ c echo "hello world!"
77
# $ echo "hello world!" | c
88
#
99
# @author Jerry Lee

tcp-connection-state-counter.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# @author @sunuslee
1010

1111
# On MacOS, netstat need to using -p tcp to get only tcp output.
12-
[ -n "$(uname | grep Darwin)" ] && option_for_mac="-ptcp"
12+
uname | grep Darwin -q && option_for_mac="-ptcp"
1313

1414
netstat -tna $option_for_mac | awk 'NR > 2 {
1515
s[$NF]++
1616
}
1717
1818
END {
1919
for(v in s) {
20-
printf "%-12s%s\n", v, s[v]
20+
printf "%-11s %s\n", v, s[v]
2121
}
2222
}' | sort -nr -k2,2

0 commit comments

Comments
 (0)