练习_while_until
#!/usr/bin/bash i=2 while [ $i -lt 25 ] do { ip=192.168.201.129 ping -c1 -W1 $ip &>/dev/null if [ $? -eq 0 ];then echo "$ip up " fi }& let i++ done wait echo "all finish..."
#!/usr/bin/bash i=2 until [ $i -gt 100 ] do let sum+=$i; let i++ done echo "sum:$sum"