[[email protected] ~/test] #vim for.sh #!/bin/bash For i in {1..3};d o For j in {101..103};d o For k in {1001..1003};d o If [$K-eq 1002];than #当执行玩第一轮i =1,j=101,k=1001, Output 1001, enter i=1,j=101,k=10
Contine 3 02 O'Clock Exit back, i=2,k=101,k=1001, Output 1001, enter i=2,k=101,k=
Fi 1002 When exiting back, i=3, in turn, is displayed.
Echo $K
Done Done Done
[[email protected] ~/test] #bash for.sh 1001 1001 1001
——————————————————————————————————————————————————
[[email protected] ~/test] #vim for.sh #!/bin/bash For i in {1..3};d o For j in {101..103};d o For k in {1001..1003};d o If [$K-eq 1002];than #当执行玩第一轮i =1,j=101,k=1001, Output 1001, enter i=1,j=101,k=10
Break 2 02 O'Clock Exit back, i=2,k=101,k=1001, Output 1001, enter i=2,k=101,k=
Fi 1002 When exiting back, i=3, in turn, is displayed.
Echo $K
Done Done Done
[[email protected] ~/test] #bash for.sh 1001 1001 1001 |