[code]if [條件];then
指令
fi
或
if [條件]
then
指令
fi
**分號相當於換行號**[code]while 條件
do
指令
done[code]until 條件
do
指令
done[code]for 變量名 in 變量取值列表
do
指令
done
for((i;i<x;i++))
do
指令
done[code]function 函數名(){
指令
return n
}
直接執行函數名,主要不帶(),是函數名
有參數的執行方法 函數名 參數1 參數2[code]case 變量名 in
1)
指令
;;
2)
指令
;;[code]使用sh -x xyz.sh 在代碼裡面設置set -x開始 set +x結束測試