From the Bash Reference Manual, §6.7 "Arrays":
Indexed arrays are referenced using integers (including arithmetic expressions […]) and are zero-based; […] ¶ The subscript is treated as an arithmetic expression that must evaluate to a number greater than or equal to zero.
So in effect, ${A[B]} means ${A[$((B))]}. This is convenient when you want something like ${A[B-1]}.
Arithmetic expressions are explained in §6.5 "Shell Arithmetic", which says in part:
Within an expression, shell variables may also be referenced by name without using the parameter expansion syntax.
So, $((B)) means $(($B)) (except that the former is smarter about some things, e.g. using zero instead of blank as a default for uninitialized variables).
[to be an executable in order to work is a language that sucks.[isn't an executable, it's a builtin. (Granted, it's a deficient one -- the behavior of the[[ ... ]]notation is far superior -- but it's not as though changing your$PATHwould suddenly break[.)[andtestare both builtins; neither is an alias for the other. They are equivalent in all respects, however, except that[expects its last argument to be](which it discards).which [trytype -a [