if [ expression 1 ]
then
Statement(s) to be executed if expression 1istrue
elif [ expression 2 ]
then
Statement(s) to be executed if expression 2istrue
elif [ expression 3 ]
then
Statement(s) to be executed if expression 3istrueelse
Statement(s) to be executed if no expression istrue
fi
case 值 in
模式1【支持正则】)
command1
command2
command3
;;
模式2【支持正则】)
command1
command2
command3
;;
*)
command1
command2
command3
;;
esac
for 变量 in 列表
do
command1
command2
...
commandN
done
例
for loop in12345
do
echo "The value is: $loop"
done