Re: Using variables in variables names

2006-03-13 Thread Mike Stroyan
On 3/13/06, Paul Jarc <[EMAIL PROTECTED]> wrote: > "Dirk H. Schulz" <[EMAIL PROTECTED]> wrote: > > Paul Jarc schrieb: > >> ac=12 eval "dings$ac=wasannersder" > > > > And how do I reference it then? > > ac=12 eval "value=\$dings$ac" > echo $value > > Or: > > ac=12 name=dings$ac echo ${!name} It see

Re: Using variables in variables names

2006-03-13 Thread Paul Jarc
"Dirk H. Schulz" <[EMAIL PROTECTED]> wrote: > Paul Jarc schrieb: >> ac=12 eval "dings$ac=wasannersder" > > And how do I reference it then? ac=12 eval "value=\$dings$ac" echo $value Or: ac=12 name=dings$ac echo ${!name} paul ___ Bug-bash mailing lis

Re: Using variables in variables names

2006-03-13 Thread Dirk H. Schulz
Paul Jarc schrieb: "Dirk H. Schulz" <[EMAIL PROTECTED]> wrote: ac=12 dings$ac=wasannersder -bash: dings12=wasannersder: command not found Variable names in assignments are not subject to expansion. So since "dings$ac", as-is, does not fit the syntax for variable names, it isn't tr

Re: Using variables in variables names

2006-03-13 Thread Paul Jarc
"Dirk H. Schulz" <[EMAIL PROTECTED]> wrote: >> ac=12 dings$ac=wasannersder >> -bash: dings12=wasannersder: command not found Variable names in assignments are not subject to expansion. So since "dings$ac", as-is, does not fit the syntax for variable names, it isn't treated as an assignment. Thi

Using variables in variables names

2006-03-13 Thread Dirk H. Schulz
Hi folks, I am sure this has been asked quite some times, but I did not find anything inspiring or helpful - in fact not too much at all. For accelerating a script I need the possibility to set up an unknown number of arrays and to name them (at least partly) with values of a variable. It is