📄 continue-nlevel.sh
字号:
#!/bin/bash# The "continue N" command, continuing at the Nth level loop.for outer in I II III IV V # outer loopdo echo; echo -n "Group $outer: " # -------------------------------------------------------------------- for inner in 1 2 3 4 5 6 7 8 9 10 # inner loop do if [ "$inner" -eq 7 ] then continue 2 # Continue at loop on 2nd level, that is "outer loop". # Replace above line with a simple "continue" # to see normal loop behavior. fi echo -n "$inner " # 7 8 9 10 will never echo. done # --------------------------------------------------------------------doneecho; echo# Exercise:# Come up with a meaningful use for "continue N" in a script.exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -