3 ms·
In bash, you can use `declare -n`. E.g. var=world declare -n tmp="hello_$var" tmp=value printf '%s\n' "$hello_world" # value I highly recommen
by singron 3y ago
In bash, you can use `declare -n`. E.g.
var=world
declare -n tmp="hello_$var"
tmp=value
printf '%s\n' "$hello_world" # value
I highly recommend this pattern if you want to emulate jagged 2d arrays or other nested data structures in bash for some reason.