[ 永遠的UNIX > Linux程式設計-11.Shell Script(bash)--(10)控制圈while/until ]
while list do list done 當list為True時,該圈會不停地執行。 例一 : 無限回圈寫法 #!/bin/sh while : ; do echo "do something forever here" sleep 5 done 例二 : 強迫把pppd殺掉。 #!/bin/sh while [ -f /var/run/ppp0.pid ] ; do killall pppd
fanqiang.chinaunix.net |