'What is the difference between operator "=" and "==" in Bash?

It seems that these two operators are pretty much the same - is there a difference? When should I use = and when ==?



Solution 1:[1]

There's a subtle difference with regards to POSIX. Excerpt from the Bash reference:

string1 == string2
True if the strings are equal. = may be used in place of == for strict POSIX compliance.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dominic Rodger