Learn about break and continue in shell script, we have the largest and most updated break and continue in shell script information on alibabacloud.com
Break in a Linux script continue exit returnBreakEnd and Exit loopsContinueThe following code is not executed in the loop and continue into the next round loopExitExit the script,Always bring an integer to the system, such as Exit 0ReturnReturning
During the loop, there are times when you need to force out of the loop without reaching the end of the loop, and the shell uses two commands to implement the function: Break and continue.
Break command
The break command allows you to jump out of
In the loop, sometimes you need to force out of the loop when the loop end condition is not reached, like most programming languages, the shell also uses break and continue to jump out of the loop.Break commandThe break command allows you to jump
In the loop, sometimes you need to force out of the loop when the loop end condition is not reached, and the shell uses break and continue to jump out of the loop.The break command allows you to jump out of all loops (all loops after the execution
a blog distinguishes the state return value in the shell -return-break-continue-exitFirst, The difference and contrast between break, continue, exit, return Condition and loop control and program return value command Knowledge table
Common shell: -------------- from "laruence's Linux private dish"
In the early UNIX era, there were many developers, so shell had many versions based on the developer's differences, such
Frequently heard Bourne shell (SH ),C shell,Commonly used
Loop Control statement:Continue: End this cycle prematurely, and go directly to the next round of cycle judgment;While CONDITION1; DoCMD1...if CONDITION2; ThenContinueFiCmdn...DoneExample: The sum of all even numbers within 100;#!/bin/bash#declare-i
In the loop, sometimes you need to force out of the loop when the loop end condition is not reached, like most programming languages, the shell also uses break and continue to jump out of the loop.Break commandThe break command allows you to jump
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.