Control flow Structure

Source: Internet
Author: User

---restore content starts---

1.if then Else statement

If condition 1

Then command 1

Elif Condition 2

Then command 2

else Command 3

Fi

If statements must be terminated with the word fi, elif and else are optional.

Simple If statement: if condition

Then command

Fi

When using the IF statement, then must be on a new line, otherwise an error is generated, and if no branch, the command delimiter must be used:

if condition; then

Command

Fi

2.if conditions

Then

Command 1

Else

Command 2

Fi

3.null command

The IF statement parts cannot be empty--some statements can already do so. To solve this problem, the shell provides: null command. Empty commands are always true.

---restore content ends---

Control flow Structure

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.