Pattern: Use of &&
in [ .. ]
test expression
Issue: -
&&
cannot be used in a [ .. ]
test expression. Instead, make two [ .. ]
expressions and put the &&
between them.
Example of incorrect code:
[ "$1" = "-v" && -z "$2" ]
Example of correct code:
[ "$1" = "-v" ] && [ -z "$2" ]