Dynamic variable names in Bash
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} From the docs: The ‘$’ character introduces parameter expansion, command substitution, or arithmetic expansion. … The basic form of parameter expansion is ${parameter}. The value of … Read more