shell ping一个IP,延时大于5,输出延时大于5s,打印输出时间:2024-12-06 08:37:44# ping一个IP,延时大于5,输出延时大于5s,打印输出 #!/bin/bash ip=$* echo $ip num=`ping -c 10 ${ip}|grep icmp_seq|awk '{print $7}'|cut -d= -f2` for snum in $num do if [ `echo "${snum}>5"|bc` -eq 1 ]; then echo "延时大于5s,现在为${snum}"; fi done