Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the Linux continue command

Shulou Source: shulou.com Published: 2022-06-01 21:11:28 09月29日 Update

In this article, the editor introduces in detail "how to use the Linux continue command", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to use the Linux continue command" can help you solve your doubts.

The common Linux command continue is used to end this loop and continue with the next for,while or until loop; you can specify which layer of the loop to continue.

Continue ends this cycle and continues with the next for,while or until loop.

Summary continue [n] parameter n (optional): an integer greater than or equal to 1 that specifies the layer from which the loop continues.

The return status is successful unless n is less than 1.

The default value of the optional parameter n for example # continue is 1. Do # jumps to the inner for loop to continue execution. For ((jacks 3 / 3 / j > 0); do if ((jacks / 2)); then # with continue 1 results the same continue fi printf "% s\ n" ${I} ${j} done done # output 3 3 3 1 2 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} done done # output result 3 3 2 3 1 3 Note this command is a bash built-in command, for related help information, please see the help command.

Read here, this "how to use Linux continue command" article has been introduced, want to master the knowledge of this article also need to practice and use to understand, if you want to know more about the article, welcome to follow the industry information channel.

Tags: Loops commands articles results content parameters help output appropriateness success examples information inner layer outer layer commonly used ideas integers new knowledge more summary Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MySQL OPPO Reno Docker Shulou Information