Like I said its a back door aproach, it circumvents the parser. which doesn't allow this syntax ${${Name}[1]} I didn't actually find this myself it was reproted on this list a long time ago. I do remember Chet saying he wouldn't break it. But other than that I can't remember the discussion all that well. As always with this topic it was a pretty lively debate.
Yhea its a constant fight getting my email clients to stop capitialising various things in code. Gesendet: Montag, 17. Juni 2013 um 13:57 Uhr Von: "Greg Wooledge" <wool...@eeg.ccf.org> An: "Linda Walsh" <b...@tlinx.org> Cc: "John Kearney" <dethrop...@web.de>, bug-bash <bug-bash@gnu.org> Betreff: Re: currently doable? Indirect notation used w/a hash On Sat, Jun 15, 2013 at 12:36:22PM -0700, Linda Walsh wrote: > John Kearney wrote: > >There is also a backdoor approach that I don't really advise. > >val="${ArrayName}[Index]" > >echo "${!val}" > ----- > Don't advise? Any particular reason? or stylistic? I'd shared this advice ("don't use it"), because I cannot for the life of me tell whether this is a bug or a feature. As near as I can tell, it is an unforeseen consequence of the parser implementation, not documented anywhere. As such, I would not rely on it to continue working in future Bash releases. P.S. you meant printf -v, not -V.