Bash: indirect reference to evaluate a variable value
If you want a variable to reference another variable in Bash, that is possible using a concept called indirect reference. Below is a simple example where ‘varname’ contains the name of another variable ‘foo’. # our variable foo=bar # our reference varname=foo # the following syntax will ERROR and DOES NOT work !!! echo “${$varname}” … Bash: indirect reference to evaluate a variable value