Add a check for $[

$[ is deprecated for the more familiar $((

Inspired by several instances of this in devstack:
  https://review.openstack.org/#/c/114097/

Change-Id: I08c02f3ba9f8afeadfc841075b7021714121bbb3