[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] inconsistency in expansions
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] inconsistency in expansions |
Date: |
Mon, 7 May 2012 09:12:04 -0400 |
User-agent: |
Mutt/1.4.2.3i |
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}.
Re: [Help-bash] inconsistency in expansions, Greg Wooledge, 2012/05/07