I am trying to write an expression using multiple logical operators and shell script as below
if [ [a != b] && [ -d "/path/to/directory"] || [a = b] && [ ! -d "/path/to/directory"] ] ; then execute some steps.
When I run this code, I get syntax error in conditional operator ']'. I tried different ways of having brackers, but could not get it to work. Can someone please help. Many thanks!