else
TLDR
Use else in bash script
SYNOPSIS
if condition; then commands; else commands; fi
DESCRIPTION
else is a shell keyword providing an alternative branch in conditional statements. It executes when the preceding if (and any elif) conditions are false.
else appears after if/elif blocks and before fi. It cannot have a condition - it catches all remaining cases. Only one else block is allowed per if statement.
This is a fundamental shell scripting construct for handling the "otherwise" case in conditional logic.
CAVEATS
Shell keyword, not standalone command. Must be within if/fi block. Cannot have condition. Only one else per if statement.
HISTORY
else is part of POSIX shell syntax from the Bourne shell, created by Stephen Bourne at Bell Labs. It provides the standard fallback mechanism in shell conditional statements.


