I’ve been looking for better way of doing it recently. Associative array sounded like overkill for me. Look what I found:
suffix=bzz
declare prefix_$suffix=mystr
…and then…
varname=prefix_$suffix
echo ${!varname}
I’ve been looking for better way of doing it recently. Associative array sounded like overkill for me. Look what I found:
suffix=bzz
declare prefix_$suffix=mystr
…and then…
varname=prefix_$suffix
echo ${!varname}