keyword
Bash else branch
Runs only if all preceding conditions fail; must appear inside if.
Formal Syntax & Structure
bash syntaxbash
else commandsReturn Value
behavior
Runs only if all preceding conditions fail; must appear inside if.
Working Example
Example Snippetbash
if false; then printf '%s\n' yes; else printf '%s\n' no; fi