Bash script: String comparison examples - Linux Tutorials - Learn Linux Configuration

The need to compare strings in a Bash script is relatively common and can be used to check for certain conditions before proceeding on to the next part of a script.

This is a companion discussion topic for the original entry at

You should explain why in some cases you use [....] and in other cases you use [[....]] with double square brackets.