怎么做到ping通则仅输出OK,否则仅输出NO_OK,无其他信息
#!/bin/bash IP=192.168.110.2 ping -c1 $IP &>/dev/null if [ $? -eq 0 ];then echo "OK" else echo "NO_OK" fi