The syntax ${!var}
works in bash
but not ksh93
. Variable indirection in ksh
uses namerefs
:
$ iname=FA
$ USER_FA=xyz
$ nameref TDUSER=USER_$iname
$ echo "${TDUSER}"
xyz
In ksh93
, the !
modifier is used to get the list of indexes from an array: ${!name[@]}
during parameter substitution.