if tests the exit status of a command — 0 means success. [[ ]] is a Bash keyword with friendlier string comparisons and pattern matching; [ is the POSIX test builtin. Combine conditions with && and ||; use elif for multiple branches.
Patterns
if tests the exit status of a command — 0 means success. [[ ]] is a Bash keyword with friendlier string comparisons and pattern matching; [ is the POSIX test builtin. Combine conditions with && and ||; use elif for multiple branches.