Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 409 Bytes

SC2110.md

File metadata and controls

23 lines (14 loc) · 409 Bytes

Pattern: Use of -o in [[ .. ]] expression

Issue: -

Description

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

Example of incorrect code:

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

Example of correct code:

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

Further Reading