Skip to content
Joachim Ansorg edited this page Nov 12, 2021 · 3 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.

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature guerraart8 to find a specific , or see Checks.

Clone this wiki locally