My version of bash appears to support negative indices directly:
$ echo $BASH_VERSION
4.3.33(1)-release
$ x=( {0..100} )
$ echo "${x[-45]}"
56
The feature was added to bash-4.3-alpha. See the change log, section 3x under 4.3-alpha.
Edit: observations about negative indices
I commented in Gordon Davisson's answer that if the subtractor is larger than the array you'll get an error. That appears to be true of negative indices in Bash 4.3 as well:
$ myarray=( {0..100} )
$ echo "${myarray[-104]}"
-bash: myarray: bad array subscript
This is incongruous with normal bash sparse arrays, for which any positive index is valid. It may not be set, but there's no error:
$ echo "${myarray[500]}"
(no output)
On the other hand, negative slicing does not suffer from this:
$ echo "${myarray[@]: -500:1}"
(no output; no error)
Summary
- The slice method is supported in old bash and immune to overflow errors, but cumbersome to read and write.
- The negative index method is straightforward to read and write, but only supported in very recent bash versions and can error if the index is too negative.
- The calculated index method is still fairly simple to read and will work in old bash versions, but can either error or give an unexpected answer if the negative value is too large.