Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 396 Bytes

SC2108.md

File metadata and controls

23 lines (14 loc) · 396 Bytes

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

Issue: -

Description

-a for logical AND is not supported in a [[ .. ]] expression. Use && instead.

Example of incorrect code:

[[ "$1" = "-v" -a -z "$2" ]]

Example of correct code:

[[ "$1" = "-v" && -z "$2" ]]

Further Reading