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