shell变量值作为新变量名

  sre

eval实现

result1="r1"
result2="r2"
result3="r3"
resultn="rn"
for i in {1..3}
do
    result=`eval echo ''"resulti"`
    echo $result
done

LEAVE A COMMENT

Captcha Code