星期二, 12月 25, 2007

Shell Script :While 用法

while Expression(當為 Expression 真時)
do
Commands
done
範例 :
a=10
while [ $a -eq 10 ]; #注意這裡有;
do
{
a=`echo "$a+1" | bc`
echo "$a\n"
}
done

沒有留言: