if [[ $VAR == 'value' ]]; then ... fi

Category: Bash Scripting

if [[ $VAR == 'value' ]]; then ... fi

If statement using double brackets (preferred)

Preferred if syntax using [[ ]] which handles more cases safely, like strings with spaces.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.