[Solved] Bash multiple ors don’t work with negatives [duplicate]


You can use this.

if [ "$1" != "something1" ] && [ "$1" != "something2" ] && [ "$1" != "something2" ]; then
    echo "Result is $1"
    # do stuff here if $1 is not equals to one of the above "somethings"
fi

Reason is even though one OR condition fails in your example, other OR conditions are true and the commands inside the if is executed.

solved Bash multiple ors don’t work with negatives [duplicate]