标签:blog io ar for strong on 2014 art log
for 列表形式
for variable in {list} do statement done for var in 1 2 3 4 do echo $var done for var in {1..4} do echo $var done for var in {start..end..step} do statement done for i in {1..100..2} do echo $i done for file in $(ls) do echo $file done for file in * do echo $file done
类c风格的for循环
for ((expression1;expression2;expression3)) do statement done for ((i=0;i<5;i++) do echo $i done
for variable in ${array[*]} do statement done array={1 2 3 4 5} for num in ${array[*]} do echo $num done
标签:blog io ar for strong on 2014 art log
原文地址:http://blog.csdn.net/zjufirefly/article/details/41145413