【发布时间】:2022-09-22 21:51:33
【问题描述】:
foo=username
bar=foo
a=$(eval echo \\$$bar)
echo ${!bar}
echo $(eval echo \\$${a^^}) # expected val
如果我不想通过变量赋值得到结果,我该怎么办?
我知道它需要一个变量名而不是一个字符串
echo $(eval echo \\$${${!bar}^^}) # error bad substitution
-
你想做什么?