Shell control structure (break and continue statements) the break statement can end the execution of while, for, until, select, and other structures, that is, jumping out of the structure. After exiting the loop, go to the done statement and continue execution. [Root @ sziit ~] # Vim breaks. sh (example )#! /Bin/bash # filename: breaksecho "enter the number: "read Nfor I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 doif [$ I-eq $ N]; thenecho "------- exit for loop -----" breakelseecho "------ current is $ I loop ----" fidone [root @ sziit ~] #. /Breaks. sh (test result) enter the number: 5 ------ current is 1 loop ---------- current is 2 loop ---------- current is 3 loop ---------- current is 4 loop ----------- exit for loop ----- The continue statement is used to skip the code in this loop, directly jump back to the starting position of the loop. If the condition is true, the next loop is started; otherwise, the loop is exited. [Root @ sziit ~] # Vim continues. sh (example )#! /Bin/bash # filename: continuesecho "output the number:" read Necho "----------------" int = 1for int in 'seq 7' doif [$ N-gt 7]; thenecho "please enter a number [1-7]" breakelif [$ N-le 0]; thenecho "please enter a number [1-7]" breakelseif [$ int-eq $ N]; thenecho "-" continuefifiecho "$ int" done [root @ sziit ~] #./Continues. sh (test result) output the number: 4------------------123-567