Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 486 Bytes

SC2234.md

File metadata and controls

23 lines (14 loc) · 486 Bytes

Pattern: Redundant (..) around test command

Issue: -

Description

You are wrapping a single test command in (..), creating an unnecessary subshell. Delete the surrounding (..) since they serve no purpose and only slows the script down.

Example of incorrect code:

([ "$x" -gt 0 ]) && foo

Example of correct code:

[ "$x" -gt 0 ] && foo

Further Reading