Linux命令行和Shell腳本編程

if判斷
if command
then
commands
fi

if command
then
commands
else
commands
fi

if command1
then
commands
elif command2
then
more commands
fi

if [ condition ]
then
commands
fi

複合條件測試
[ condition1 ] && [ condition2 ]
[ condition1 ] || [ condition2 ]

case語句
case variable in  
pattern1 | pattern2) commands1;;  
pattern3) commands2;;  
*) default commands;;  
esac 


for循環
for var in list
do
commands
done

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章