博客是我工作的好帮手,遇到困难就来博客找资料
分类: 系统运维
2014-12-01 21:11:22
#!/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