运维网's Archiver
论坛
›
Shell/Powershell
› shell之变量间接引用
yxixi
发表于 2018-8-22 13:49:34
shell之变量间接引用
1. eval
a=b
b=c
eval d=\$${a}
echo $d
输出:c
2.${!}
a=b
b=c
echo ${!a}
输出:c
间接修改b的值
eval $a=d
间接修改c的值
eval ${!a}=e
页:
[1]
查看完整版本:
shell之变量间接引用