if is a judgment statement that determines whether something meets a set condition.
1, the format is:
if?statement formatif?condition
then
Commandelse
CommandfiDon't forget this ending
2, the three kinds of conditional expressions for if:
if?command? thenif?function?then command execution success, equal to the return of 0? (such as grep?,find a match)? Failure of execution returns non-0? (grep, no match found)
if?[?expression_r_r_r?]?then expression results in true, then returns 0, if directs non-zero values to then
if?test?expression_r_r_r?then expression results in false, then returns non-0 if leads the non-0 value to then