Cloud computing tutorials for good programmers share syntax parsing of if nesting functions
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)