歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Linux shell編程基礎 七、流程控制

Linux shell編程基礎 七、流程控制

日期:2017/3/3 16:32:10   编辑:關於Linux

流程控制

if-then

if 條件; then

動作

fi

if-then-else

if 條件; then

動作1

else

動作2

fi

if 條件1; then

動作1

elif 條件2; then

動作2

else

動作3

fi

for

for 變量 in 列舉

do

命令

done

while

while 條件

do

命令

done

until

until 條件

do

命令

done

break continue

break跳出當前循環,continue提前進入下一次循環

Copyright © Linux教程網 All Rights Reserved