pingres=`ping -c 1 baidu.com | sed -n '/64 bytes from/p'` if [ -z "$pingres" ] then echo "network error" exit 1 fi原文链接:https://www.f2er.com/bash/391728.html
pingres=`ping -c 1 baidu.com | sed -n '/64 bytes from/p'` if [ -z "$pingres" ] then echo "network error" exit 1 fi原文链接:https://www.f2er.com/bash/391728.html