revised and simplified version using the new -n declaration :
unset a b c x
declare -A a b ; for i in k{1..2} ; do a[a$i]=a_val_$i b[b$i]=b_val_$i ; done ; echo -e "${a[@]}\n${b[@]}"
declare -n x
declare -a c=( a b )
for x in "${c[@]}" ; do for k in "${!x[@]}" ; do echo -n "$k = " ; echo...
Well, I'm new to tek-tips (I've just registered) and I see your question has still no answer. I'm pretty sure you have the answer since, but anyway, here is mine:
parameter expansion does not accept nesting (you can't do ${${var}}. You can have an indirection with '!' ( ${!var} ), but in the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.