Shell

Shell

Made by DeepSource

Deprecated $[..] used SH-2007

Bug risk
Major

The $[..] syntax was deprecated in Bash 2.0 and replaced with the standard $((..)) syntax from Korn shell. It is therefore recommended to use $((..)) instead.

Problematic code:

n=1
n=$[n+1]

Preferred code:

n=1
n=$((n+1))