Linuxshell programming ---- loop structure

Source: Internet
Author: User
Linuxshell programming ---- loop structure 1for loop 1for loop is a common structure in LinuxShell. for loop has three structures: list for loop and list for loop without List, the third type is C-style for loop. 2 List for loop Linux shell programming ---- loop structure 1 for Loop 1 for loop is a common structure in Linux Shell. a for loop has three structures. one is a list for loop, the second is a for loop without a list, and the third is a C-style for loop. 2 list for loop for variable in list do statement done 3 for loop for variable do statement done 4 class C style for (expr1; expr2; expr3 )) do statement done 2 while Loop 1 while loop structure while expression do statement done 3 until Loop 1 when executing while Loop 1 as long as the expression exit status is 0, it will always execute the loop body. The until command is similar to the while command, but the difference is that when the exit status of the expression in the until loop is not 0, the loop body will always be executed. 2 until structure the untile expression do statement done 4 loop control symbol 1 break statement can be applied in for, while and until loop statements for forced loop, that is, ignore the limitations of any other statements and loop conditions in the loop body. 2. the continue loop controller is used in the for, while, and until statements to allow the script to skip the subsequent statements and execute the next loop.
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.