- The
IF
statement:
- The
IF
command is used to compare results.
- There are three forms of the
IF
command:
- Block
- This is the traditional multi-line
IF
seen in many programming
languages.
- This can be combined with
ELSEIF
and ELSE
clauses.
- One-Line
- This is an
IF
statement with a single action that, as the name
implies, is all on a single line.
- Quick Check
- This is a special form of the
IF
statement that can only be used
in the shell.
- This form evaluates the expression and prints the value to the terminal.