天天看点

shell编程入门步步高(七、流程控制)

流程控制

if-then

if 条件; then

   动作

fi

if-then-else

   动作1

else

   动作2

if 条件1; then

elif 条件2; then

   动作3

for

for 变量 in 列举

do

    命令

done

while

while 条件

until

until 条件

break continue

break跳出当前循环,continue提前进入下一次循环

本文转自 justiceplus 51CTO博客,原文链接:http://blog.51cto.com/johnwang/326073,如需转载请自行联系原作者