help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] indirection


From: Bill Gradwohl
Subject: Re: [Help-bash] indirection
Date: Thu, 15 Mar 2012 07:37:51 -0600

On Wed, Mar 14, 2012 at 3:07 PM, Greg Wooledge <address@hidden> wrote:
On Wed, Mar 14, 2012 at 01:48:25PM -0600, Bill Gradwohl wrote:
> If one level of indirection is ${!xxx}, how does one code 2 levels without
> using an intermediate variable?

I'm pretty sure it's not possible.  May I ask why you want to do that?
Perhaps some associative arrays would be better suited to solving
your problem.  They usually are, when people are messing with indirect
evaluation.

Curiosity.

I've written code professionally for over 30 years in over 20 languages. Bash syntax trips me up more than any other language I'm familiar with. I was experimenting with various features to try to get a better handle on what the syntax will and won't do. I don't have a real use for double indirection, just a curiosity about the bash syntax that may or may not allow it.

I've found only one real use for indirection as it concerns maintaining numeric position information when working with passed parameters. If bash had some form of pointer or addressing ability, certain things would be a lot easier to accomplish and the use of eval and indirection would decrease, at least for me.

I like bash as a scripting language, but the syntax routinely trips me up so I keep experimenting to try to get a better handle on it.

--
Bill Gradwohl


reply via email to

[Prev in Thread] Current Thread [Next in Thread]