在 shell 脚本中,我正在从数据库中检索数据并尝试打印它,但它没有像我尝试那样打印。
我的代码是:
mysql -uroot -proot -Dproject_ivr_db -rN --execute "SELECT Regular FROM
Fee_MSc WHERE Fee_Type='Total:'" | while read value
x=1
do
echo "V,FeeRegular_$y=$value"
let "y+=1"
done
echo "V,fee_msc_regular="for students on regular basis admission fee
including other charges is $FeeRegular_1 and semester fee is $FeeRegular_2""
输出是:
V,FeeRegular_1=12590
V,FeeRegular_2=12850
V,fee_msc_regular=for students on regular basis admission fee including other
charges is and semester fee is
它不会在字符串输出中打印$FeeRegular_1
和的值。$FeeRegular_2
如何在输出字符串中获取这些变量的值?