You can find old bash source here. In particular I downloaded bash-1.14.7.tar.gz. In the documentation/bash.txt
you will find:
Arithmetic Expansion
Arithmetic expansion allows the evaluation of an arithmetic expression and the substitution of the result. There are two formats for arithmetic expansion:
$[expression]
$((expression))
The references to $[
are gone in doc/bash.html
from the bash-doc-2.0.tar.gz download and the NEWS
file mentions that:
The $[...]
arithmetic expansion syntax is no longer supported, in favor of $((...))
.
$((...))
is also the standard syntax for an arithmetic expansion, but may have been added to the standard later than the original Bash implementation.
However, $[...]
does still seem to work in Bash 5.0, so it's not completely removed.
bash
specific$[...]
syntax is non-standard. The$((...))
(that stems fromksh
) is POSIX standard.man bash | grep -E '\$\['
. Output: The old format $[expression] is deprecated and will be removed in upcoming versions