Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 450 Bytes

SC2109.md

File metadata and controls

23 lines (14 loc) · 450 Bytes

Pattern: Use of || in [ .. ] test expression

Issue: -

Description

|| cannot be used in a [ .. ] test expression. Instead, make two [ .. ] expressions and put the || between them.

Example of incorrect code:

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

Example of correct code:

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

Further Reading