Skip to content

Files

Latest commit

 

History

History
25 lines (16 loc) · 560 Bytes

SC2323.md

File metadata and controls

25 lines (16 loc) · 560 Bytes

Pattern: Use of extra parentheses

Issue: -

Description

ShellCheck found an entire arithmetic expression wrapped in parentheses. This does not serve a purpose since the expression is already clearly delimited by the construct it's in, such as array[..]= or $((..)) in the example.

Example of incorrect code:

array[(x+1)]=val
echo $(( (x+1) ))

Example of correct code:

array[x+1]=val
echo $((x+1))

Further Reading