perl 分析binlog 生成update sql

if [ $# -ne 2 ]
then
   echo "请输入update xx"
else
perl ./get_num.pl $1 $2 

if [ $? -eq 0 ]
  then
   sh ./sed.sh 
fi
fi


open (A,"<","a.txt");
open (B,">","b.txt");
$a=$ARGV[0];
$b=$ARGV[1];
 while (<A>) {  
              $num++;  
              if (( $_ =~/$as+$b/i ) or ($_ =~/$as+`zjzc`.`$b/i) )  { $c = $num;print B ("$c
"); };
               }  



 cat b.txt | while read A 
do
num1=`expr $A - 3`
num2=`expr $A + 3`
sed -n ''$num1','$num2'p' a.txt
done

原文地址:https://www.cnblogs.com/hzcya1995/p/13351219.html