On 2/25/2011 4:22 AM, Andreas Schwab wrote:
"Steven W. Orr"<ste...@syslang.net>  writes:

517>  r=($(eval echo "\${${a_all[1]}[@]}"))

If you use $(eval echo ...) you are almost always doing it wrong.

eval "r=(\"\${${a_all[1]}[@]}\")"

Andreas.


Thanks. I changed things of the form

r=($(eval "echo "\${${a_all[1]}[@]}\""))
to
eval "r=(\"\${${a_all[1]}[@]}\")"

One place where I can't see how to eliminate the construct is where I pass in the name of an array and parse it using set

set -- $(eval echo \"\${$name[@]}\")

would I be better off with something like

eval "set -- \"\${$name[@]}\""

?

TIA

--
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

Reply via email to