歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> SHELL編程

shell_ping其他機器

shell_ping其他機器   #!/bin/sh echo "---------------------------------------" server0="localhost" server1="172.72.101.46" server2="172.72.101.47" server3="172.72.103.221" server4="172.72.103.222" server5="172.72.103.223" server6="172.72.103.224" server7="172.72.103.225" server8="172.72.103.246" server9="172.72.103.227" server10="172.72.103.228" pingcmd() { prefixt="SERVER $1 PING $2" ping -w 1 -c 1 $2>/dev/null ret=$? if [ $ret -eq 0 ]   then printf "$prefixt OK\n" else printf "$prefixt ERROR\n" fi
Copyright © Linux教程網 All Rights Reserved