Get the App
SLTechnology News&Howtos  ›  Servers  › 

Select, loop sentence structure summary

Shulou Source: shulou.com Published: 2022-06-03 06:22:11 09月21日 Update

Select sentence: if,case,select.

Loop statement: for,while,until.

Note: the following variable is named var

Forward + reverse structure: if,case

If format:

If condition judgment

Then

Content

Elif

Then

Content

Else

Content

Fi

Case format:

Case $var in

1).

2).

...

*).

Esac

Do + done structure: for,while,until,select

For format:

For var in list

Do

Content

Done

While format:

While condition judgment-"if true, enter the cycle."

Do

Content

Done

Until format:

Until condition judgment-"if false, enter the cycle

Do

Content

Done

Select format:

Select var in list

Do

Break

Done

Tags: Content format loop condition structure statement selection variable Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Linux Redmi Xiaomi macOS