2 SC2007
Joachim Ansorg edited this page 2021-11-12 19:15:37 +01:00

Use $((..)) instead of deprecated $[..].

Problematic code

n=1
n=$[n+1]

Correct code

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

Rationale

The $[..] syntax was deprecated in Bash 2.0 and replaced with the standard $((..)) syntax from Korn shell

Exceptions

None.

See also