This article is part of the Linux Shell Series Tutorial (11), more Linux shell tutorials: Linux Shell Tutorials
In the previous Linux Shell Series tutorial (10) Shell for loop, we have introduced a for loop for Shell loop statements, this
Java cyclic statements-general Linux technology-Linux programming and kernel information. The following is a detailed description. Java loop statements include for, while, and do-while. These statements create what we usually call a loop (loops ).
Linux while loop and for loop code example introduction, linuxwhile
There are three types of loops in the script, which can be divided into two types: while LOOP and for loop.1. while Loop
The while loop can be divided into two types: whiel do done
How to control the while loop through another event and use keystrokes to control the while loop when necessary1, set a loop flag. Loop in the main process and check the loop flag in each loop to decide whether to continue, change the flag after
In previous studies, we learned that the while loop shape is:while expression;Statement...DoneThis grammatical structure loops as long as the expression meets the criteria to execute the statement in the loop body, or the loop is rolled out.Two
To understand the meaning of the while loop, the purpose of using the while loop is to iterate multiple times!
A while loop is a loop that determines whether to exit according to the criteria specified after the while keyword.
If you want to quit
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
while Introduction to Commands:While loop: For scenarios where the number of cycles is unknown, there is an exit condition, otherwise it becomes a dead loop.1 . Command format:Grammar:While CONDITION; DoStatement...Done2 . Command function:While
1 for LoopSyntax: for variable name in condition; ; doneExample 1#!/bin/bashsum=0for i in `seq 1 100`;dosum=$[$sum+$i]doneecho $sumExample 2Find all files with the suffix. txt in the/123 directoryBulk Modify. txt to. txt.bakAnalysis:There are two
I. Shell Condition Statement (if usage)
If statement structure [if/then/Elif/else/FI]
If condition test statement
Then
Action
[Elif Condition
Action
Else
Action
]
Fi
If you are not clear about the conditional test statement, refer to:
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.