Bash
Conditionals Commands
Control flow with Bash conditionals. Learn if/elif/else, case statements, test operators, and comparisons.
21 commands
Pro Tips
Use '[[ ]]' instead of '[ ]' for safer string comparisons and regex support.
Use '(( ))' for arithmetic comparisons: '(( a > b ))' is cleaner than '[ $a -gt $b ]'.
Common Mistakes
Always quote variables in '[ ]' tests: '[ "$var" = "value" ]' to avoid word splitting.