Skip to content
Joachim Ansorg edited this page Nov 12, 2021 · 4 revisions

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.

ShellCheck

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

Clone this wiki locally