I scratch my head over this, can't find the bash link talking about it.
In the code below
host_color=${uphost}_host_color host_color=${!host_color}
What does the second line do? what the operator does! in this case?
This is a short form for indirect references .
$ foo=bar $ bar=bas $ echo ${!foo} bas
It looks like a similar construction of $ {! foo *} expands to the names of all variables whose name begins with foo:
$ foo1=x $ foo2=y $ echo ${!foo*} foo1 foo2
From the b ash directory :
If the first character of the parameter is an exclamation point (!), The level of the indirectness variable is entered. Bash uses the value of the variable formed from the rest of the parameter as the name of the variable; this variable is then expanded, and this value is used in the rest of the substitution, and not the value of the parameter itself. This is called an indirect extension. An exception is the decompositions of $ {! prefix *} and $ {! name [@]} described below.