我想使用echo命令的输出作为变量名.喜欢,
var1="test" var2="script" echo ${$1}
如果$1是var1 echo应该打印测试.
$1
${$1} 抛出错误"糟糕的替代"
${$1}
bash shell
bash ×1
shell ×1