bash shell —— TCP_Helper.sh
作者:互联网
#!/bin/bash n=100 while [ $n -gt 0 ]; do sleep 10s n=$((n-1)) msg=$(netstat -ant |grep -i "CLOSE_WAIT"|wc -l) msg2=$(netstat -ant |grep -i "ESTABLISHED"|wc -l) echo "----" echo "established:$msg2" echo "CLOSE_WAIT:$msg" done
标签:shell,wc,Helper,msg2,TCP,echo,ant,msg,CLOSE 来源: https://www.cnblogs.com/panpanwelcome/p/14957848.html