Skip to content
Vidar Holen edited this page Oct 4, 2015 · 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.

Clone this wiki locally

⌂ 换网址