bug-bash
[Top][All Lists]
Advanced

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

Re: indirection as an lvalue


From: Greg Wooledge
Subject: Re: indirection as an lvalue
Date: Fri, 24 Apr 2009 13:54:22 -0400
User-agent: Mutt/1.4.2.2i

On Fri, Apr 24, 2009 at 11:49:43AM -0600, Bill Gradwohl wrote:
> This is a trivial example, but gives you the idea.
> for x in 'VAR_A' 'VAR_B' 'VAR_C'; do
>    # What I'd like to say is 
>    !x="hello" 
> done

In bash 4, you can use associative arrays, which gives you what you
really want.

Apart from that, there are several tricks for doing this; I have a
fairly good list of them at http://mywiki.wooledge.org/BashFAQ/006




reply via email to

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