3 SC2108
Joachim Ansorg edited this page 2021-11-12 19:33:51 +01:00

In [[..]], use && instead of -a.

Problematic code:

[[ "$1" = "-v" -a -z "$2" ]]

Correct code:

[[ "$1" = "-v" && -z "$2" ]]

Rationale:

-a for logical AND is not supported in a [[ .. ]] expression. Use && instead.

Exceptions:

None.