|
From: | Pierre Gaston |
Subject: | Re: Curious case of arithmetic expansion |
Date: | Sun, 23 Apr 2017 15:43:49 +0300 |
What I’m saying is, that if bash does recursively apply expansionmechanisms on the identifiers until it can retrieve a number,it should do it symmetrically. That is,it should remember what chain of expansion had been necessary fora particular number to appear at the end of the expansion.So instead of124 moo 123The echo command should producebar moo 124(The expansion chain here was foo->bar->moo->123)No it is really indirection. Bash even has a special (and very limited) syntax for that.It's because it's not really indirection, rather the content of the variable is evaluated:Consider$ foo=bar; bar=mooYou can get the string „moo“ through foo by using$ echo ${!foo}$ echo ${!!foo} # or something else does not work, though...
[Prev in Thread] | Current Thread | [Next in Thread] |