Linux shell programming process control, linuxshell

Source: Internet
Author: User

Linux shell programming process control, linuxshell

If statement:

Test is used in the past.

Example 1: When the hard disk exceeds 80%, notify the Administrator


Example 2: Automatically Restart Apache when it is disabled


Example 3: multi-branch if statement


Example 4: Back up the etc directory



Case statement:


For statement:


Batch decompression is similar



Batch add users



While statement:


Until loop:

Contrary to the while LOOP, as long as the judgment condition is not true, the condition is always in the loop, knowing that the condition is true

Use until to achieve the same effect as the above example:



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.