Skip to content
Vidar Holen edited this page Oct 4, 2015 · 2 revisions

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.

Clone this wiki locally