Created SC2007 (markdown)

Dave Tucker
2016-09-14 15:01:12 +01:00
parent eac6ec274b
commit 2bfc5a9fa7

27
SC2007.md Normal file

@@ -0,0 +1,27 @@
# Use $((..)) instead of deprecated $[..]
### Problematic code
```sh
n=1
n=$[n+1]
```
### Correct code
```sh
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
- http://unix.stackexchange.com/questions/209833/what-does-a-dollar-sign-followed-by-a-square-bracket-mean-in-bash