I realize this is a simple question, but I am finding a hard time getting an answer due to the finnicky syntax requirements in bash. I have the following script:
if ! [ [ -z "$1" ] || [ -z "$2" ] ]; then
echo "both arguments are set!"
fi
I get the following output when I run it without arguments:
./test: line 3: [: -z: binary operator expected both arguments are set!
I am not expecting any output - neither argument is set. What am I doing wrong?