The IF statement

Syntax

if condition ; then
    command
{elif condition ; then
    command}
[else
    command]
fi

Discussion

  • The elif branch («else if») is optional and may be repeated as needed.
  • The else branch is optional.
  • command may be a single command or multiple commands, which are either placed on different lines or divided by ; on the same line.

2020–07–11