if condition;then
elif condition;commandthencommandelsecommandfi
*value支持元字符(正则表达式)case testVal invalue1)command;;value2)command;;*)command;;esac
for testValue in lists
do
command
done
until condition
do
command
done*循环至少执行一次
while conditondocommanddone
function_name(){}
#!/bin/sh
loop=0
while [ "$#" -ne "0" ]
do
echo $1
shift
done
原文:http://www.cnblogs.com/shadowwalker/p/3599497.html