标签: bash environment
如果我有一个var,其值是HOME,PATH或My_Var等,我如何从var获得$ HOME,$ PATH?
如下所示:
VAR="HOME" echo ${$VAR} # does not work
答案 0 :(得分:4)
就这么简单:
VAR="HOME" echo ${!VAR}
More on indirect references