First, Introduction
In shell programming, circular commands are used to control the execution of certain statements under certain conditions, with three commonly used loop statements: for, while, and until. While loops and for loops belong to the
In the for loop described earlier, you must first create an element list to determine the number of cycles. However, consider the following example: If you enter "quit", the program will exit, otherwise, convert the characters entered by the user
Linux Shell series (12) Shell until loop, shelluntil
This article is Part 12 of the Linux Shell series tutorials. For more Linux Shell tutorials, see the Linux Shell series tutorials.In the last two articles: Linux Shell series (10) Shell for loop
The format of the for loop described earlier is as follows:For VARNAME in List;doStatement...DoneThe For loop in this format is the statement that assigns each value in the list to the variable varname, and then executes in the loop body. When no
While loop structureWhile condition-determining expressionDoStatement blocks executed when the condition is judged............DoneExample: Using while to output a number 1 to 10 (ascending output)J=1While [$j-le 10]Do#useradd wsyht$j#userdel-R wsyht$
One, while loop
The while loop is used to continuously execute a series of commands and to read data from an input file; a command is usually a test condition. The format is:
Copy Code code as follows:
While command
Todo
Command1
The Until loop executes a series of commands until the condition is true. The Until loop and the while loop are just the opposite of the processing mode. The general while loop is better than the until loop, but at some point it is only rare that
The Until loop executes a series of commands until the condition is true. The Until loop and the while loop are just the opposite of the processing mode. The general while loop is better than the until loop, but at some point it is only rare that
This article mainly introduces the Repeat...until Loop statement Usage Tutorial in Lua, is a basic tutorial in Lua's introductory learning, and needs friends to refer to the following
Unlike for and while loops, the loop condition is tested at the
The Until loop executes a series of commands until the condition is true. The Until loop and the while loop are just the opposite of the processing mode. The general while loop is better than the until loop, but at some point it is only rare that
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.