From https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
The basic form of parameter expansion is
${parameter}
. ...If the first character of parameter is an exclamation point (
!
), a level of variable indirection is introduced. Bash uses the value of the variable formed from the rest of parameter 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 of parameter itself. This is known as 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....
${!prefix*} ${!prefix@}
Expands to the names of variables whose names begin with prefix , separated by the fi rst character of the IFS special variable. When ‘@’ is used and the expan- sion appears within double quotes, each variable name expands to a separate word.
${!name[@]} ${!name[*]}
If name is an array variable, expands to the list of array indices (keys) assigned in name. If name is not an array, expands to 0 if name is set and null otherwise. When ‘@’ is used and the expansion appears within double quotes, each key expands to a separate word.
Can you give some examples for the quoted paragraphs? I have no clue what they mean.