1. if 语句
if
then
elif
then
else
fi
一般多与test 即[] 连用
if [ -f file ] 判断一个文件是否存在
if [ string1 = string2 ] 判断两个字符串是否相等
2.for语句
for foo in bar fud 43
do
echo $foo
done
3.while 语句
while
do
done
4.until 语句
until
do
done
5.case语句
case $val in
yes | Y) echo "good" ;;
no | N) echo "hello";;
* ) echo "hehe"
exit 1
;;
esac
exit 0