bttb
August 28th, 2008, 06:09 PM
Hi all,
I have two arrays in my script which turned out to be quite handy. The first holds variable names, the second options:
array[0]=THREADS OPTION[0]=4
array[1]=COLOR OPTION[1]=GREEN
array[2]=BOLDFACE OPTION[2]=YES
... ...
I'd like to go from there to here:
THREADS=4
COLOR=GREEN
BOLDFACE=YES
...
$ echo $COLOR
GREEN
Anybody knows how to achieve this without using eval (${!VAR} is fine)?
Kind regards!
I have two arrays in my script which turned out to be quite handy. The first holds variable names, the second options:
array[0]=THREADS OPTION[0]=4
array[1]=COLOR OPTION[1]=GREEN
array[2]=BOLDFACE OPTION[2]=YES
... ...
I'd like to go from there to here:
THREADS=4
COLOR=GREEN
BOLDFACE=YES
...
$ echo $COLOR
GREEN
Anybody knows how to achieve this without using eval (${!VAR} is fine)?
Kind regards!