Você está correto em suas suposições.
A documentação mais detalhada está escondida em info bash
:
3.5.3 Shell Parameter Expansion
[...]
The basic form of parameter expansion is
${PARAMETER}
. The value ofPARAMETER
is substituted. ThePARAMETER
is a shell parameter as described above (*note Shell Parameters::) or an array reference (*note Arrays::). The braces are required whenPARAMETER
is a positional parameter with more than one digit, or whenPARAMETER
is followed by a character that is not to be interpreted as part of its name.If the first character of
PARAMETER
is an exclamation point (!
), andPARAMETER
is not a NAMEREF, it introduces a level of variable indirection. Bash uses the value of the variable formed from the rest ofPARAMETER
as the name of the variable; this variable is then expanded and that value is used in the rest of the substitution, rather than the value ofPARAMETER
itself. This is known as 'indirect expansion'. IfPARAMETER
is a nameref, this expands to the name of the variable referenced byPARAMETER
instead of performing the complete indirect expansion. The exceptions to this are the expansions of${!PREFIX*}
and${!NAME[@]}
described below. The exclamation point must immediately follow the left brace in order to introduce indirection.