boolean expression in bash

Can someone, please, help me to make this condition valid/accepted in bash?
I really cannot.
I'm stuck with the brackets...

This one tells me: missing `]'

if [ $# != 1 || [ "$1" != "ALL" && "$1" != "PART" ] ]; then
                # NOTIFY ERROR...
fi

And... I'd also appreciate a link to bash documents that explain these things. All what I've seen (a lot) is quite superficial.

You can't nest [ ].

You can't use && inside [ ]. You can inside [[ ]].

 if [ $# != 1 ] || [[ "$1" != "ALL" && "$1" != "PART" ]]; then
                # NOTIFY ERROR...
fi

test constructs

1 Like

Thanks!!