1. if else:
if condition then command1 elif condition2 then command2 else command3 fi
测试:
结果:
2. for循环:
for var in item1 item2 ... itemN do command1 command2 ... commandN done
测试:
结果:
for的另一种形式, 双引号中的变量不用加$
for((assignment;conditoon;next))
do command1; command2; done
测试:
结果:
3. while:
while condition do command done
测试:
结果:
上面三种就够用了
4.break continue命令
测试:
结果: