continue [N]
!subtitle:功能
结束本轮循环,继续下一轮循环。
!subtitle:类型
Bash 内置命令。
!subtitle:参数
N - 继续第 N 层循环的下一轮;默认为 1
for ((x=0; x<10; x=x+1)); do
for ((y=0; y<10; y=y+1)); do
for ((z=0; z<10; z=z+1)); do
echo $x $y $z
continue 3 # 继续第 3 层循环的下一轮
done
done
done
| 命令 | 说明 |
|---|---|
| break | 跳出循环 |
continue: continue [n]
Resume for, while, or until loops.
Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.
If N is specified, resumes the Nth enclosing loop.
Exit Status:
The exit status is 0 unless N is not greater than or equal to 1.