本文共 557 字,大约阅读时间需要 1 分钟。
#!/bin/bash
echo ""> ./config_singer_task.xml.bak
cat ./config_singer_task.xml | while read line
do
#echo $line
line2=`echo $line|grep LuckyCollectDesc|grep SingerGrowthAward`
if [ "$line2" = "" ];then
echo $line
echo "$line" >> ./config_singer_task.xml.bak
else
grow=`echo $line2|awk -F '"' '{print $2}'` #第二列
grow2=$(($grow*2)) 第二列乘以2
echo $grow " " $grow2
line3=`echo ${line2/$grow/$grow2}`
echo $line2
echo $line3
echo "$line3" >> ./config_singer_task.xml.bak
fi
done