Get the App
SLTechnology News&Howtos  ›  Servers  › 

Cloud computing tutorials for good programmers share syntax parsing of if nesting functions

Shulou Source: shulou.com Published: 2022-06-03 07:56:25 10月03日 Update

Cloud computing tutorials for good programmers share syntax parsing of if nesting functions

Use the following two judgment syntax to judge the number 18, respectively, for the divisible result of 2 and 3.

Multi-condition judgment

If [test condition 1]; then

Statement executed when test condition 1 is met

Elif [test condition 2]; then

Statement executed when test condition 2 is met

Elif [test condition 3]; then

Statement executed when test condition 3 is met

Else

The statement executed when the test condition is False

Fi

Parsing of if nested syntax

If [test condition 1]; then

If [test condition 2]; then

The statement is output only when both condition 1 and condition 2 are met.

Fi

Fi

Memorization of No.3 Special symbols

The name of the execution of the $0 script

$* all parameters of this script. This option can have more than 9 parameters.

$# the number of parameters in this script

The ID number of the current process that the $script is running

$! The process ID number of the last process running in the background

​

The nth parameter value of the script, natively 1... 9, position variable

$? The return value of executing the previous instruction (displays the exit status of the last command. 0 means there is no error, and any other value indicates an error)

Tags: Conditions tests scripts statements parameters syntax processes errors runs functions tutorials programs programmers special number location variables at the same time name background Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker NVidia Huawei Linux Redmi