I am trying to test if a string is not equal to either of two strings. For example, in C++, this would be written as:
if (string1 != string2 || string1 != string3)
However, attempting to create the Bash equivalent
if [ "$string1" != "$string2" || "$string1" != "$string3" ]
results in the error [: missing ']'
and (contents of string1): command not found
.
I'm not exactly too sure what is causing it, but searching didn't turn up any results I could use. It would be greatly appreciated if one could point out how the code I am using can be changed to suit the needs, and if possible, provide sample code.
Thanks in advance! Harry