Print a bash array by name
This uses eval
, as that is the only way to reference an array
that has its name stored in a variable while retaining indices (for
associative and sparse arrays).
More info on why indirection won't work for this here
http://mywiki.wooledge.org/BashFAQ/006#Evaluating_indirect.2Freference_variables