On Mon, May 07, 2012 at 07:09:15AM -0600, Bill Gradwohl wrote:
${$x} isn't a valid expansion, so it throws an error, the pattern isn't
matched, and nothing happens.
I see it produces an error, but I still don't see why. If $x expands to 3
why don't I get ${3} and then the expansion of ${3}? Why is it illegal?
What bash rule makes it so?
The definition of parameter expansion:
$parameter
${parameter[operator]}
$x is not a valid parameter. x is a valid parameter. 3 is a valid
parameter. $x is not. Therefore you cannot write ${$x}.
You just got me to realize that these work