其他分享
首页 > 其他分享> > ash 数组操作

ash 数组操作

作者:互联网

for myi in 0 1 2 ; do
eval mvar$myi=$myi
done

myi=1
eval newvar="\$mvar$myi"
echo $newvar

eval newvar="\$mvar0"
echo $newvar

-----------------------------------------------------------

eval mvar0=0
eval mvar1=2
eval mvar2=3

eval newvar="\$mvar0"
echo $newvar
eval newvar="\$mvar2"
echo $newvar

标签:echo,mvar,数组,newvar,myi,eval,mvar0,操作,ash
来源: https://www.cnblogs.com/xpylovely/p/16554491.html