I have a problem with if
in bash script. I've written the following if condition but it produces an error:
if [[ "$capacity" != *10 && "$capacity" != *20 ]] || [[ "$capacity" != *80 && "$capacity" != *100 ]]; then
Simply, I want to compare (two values not equals to) || (two values not equals to) condition using or operator
*
doing there?/bin/sh
is not bash. They're different shells implementing different languages. (Even when/bin/sh
is a link to the bash executable, it runs in POSIX compatibility mode when run under that name).