4 SC2110
Joachim Ansorg edited this page 2021-11-12 19:34:17 +01:00

In [[..]], use || instead of -o.

Problematic code:

[[ "$1" = "-v" -o "$1" = "-help" ]]

Correct code:

[[ "$1" = "-v" || "$1" = "-help" ]]

Rationale:

-o for logical OR is not supported in a [[ .. ]] expression. Use || instead.

Exceptions:

None.