从日志中找出资产限制出错的并处理

#!/bin/bash
export LD_LIBRARY_PATH=/home/server/lib:$LD_LIBRARY_PATH
cd /home/server/tools/unfreeze_fund/shell/
date

Date=$(date +%Y%m%d)
grep "UnFreezeAccount fail"  "/home/server/tongxin_srv/log/tongxin_srv.log.$Date" | grep "0x109_0x1"  > "../log/process.log.$Date"

#env=0
env=1
while read EACH_LINE
do
	# 空行或全部由空格、制表符所组成的行被忽略
    if [ -z "`echo $EACH_LINE | grep -v ^$`" ]; then
        continue
    fi
    # 行首第一个非空字符为#时,此行被认定为注释,不进行任何处理
    commentflag=${EACH_LINE:0:1}
    if [ "${commentflag}"x == "#"x ]; then
        continue
    fi
    LOAN_ID=`echo $EACH_LINE | awk -F: ' { print $7; } ' | awk -F] '{ print $1 }'`

	echo "loan_id:"$LOAN_ID
	../bin/unfreeze_fund -loan_id=$LOAN_ID -env=1
done < ../log/process.log.$Date

你可能感兴趣的:(从日志中找出资产限制出错的并处理)