Use the continue command of linux to end this cycle
This article mainly introduces the use of linux continue command to end this cycle, the article is very detailed, has a certain reference value, interested friends must read it!
The main purpose of continue is to end this loop and continue with the next for,while or until loop; you can specify which layer of the loop to continue.
Syntax format: continue
Common parameters:
Reference example
The default value of the optional parameter n for continue is 1:
For ((iposit I > 0 poster imuri -)); do for ((job3umbj > 0 posit j -); do if ((jobless 2)); then continue fi printf "% s% s\ n" ${I} ${j} done done # output result 3 3 3 1 2 3 2 1 1 1
When n is 2: jump to the outer for loop to continue execution:
For ((iposit I > 0 poster iMurb -)); do for ((Job310 j > 0 positjmure -)); do if ((jogwash 2)); then continue 2 fi printf "% s% s\ n" ${I} ${j} donedone # output result 3 3 2 3 1 3 or above is to use the linux continue command to end this cycle, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!