Last updated 3 years ago
In bash, one can use the syntax ${!varname} to expand the value of the variable with the name $varname.
${!varname}
$varname
Source:
LESS='-p Parameter Expansion' man bash
PARAM_REV=master varname=PARAM_REV echo $varname # PARAM_REV echo ${!varname} # master