update 语句示例:
UPDATE `zjzc`.`QRTZ_SCHEDuler_state` SET `ip`='220.191.34.246' WHERE `sn`='3117764' and`startTime`='2016-07-20 00:02:40';
UPDATE QRTZ_SCHEDULER_STATE SET LAST_CHECKIN_TIME = 1472174086295 WHERE SCHED_NAME = 'ReportControlScheduler' AND INSTANCE_NAME = 'auto'
if (( $_ =~/$b\s+$c/i ) or ($_ =~/$b\s+`zjzc`\.`$c`/i) )
wjdb3:/root/sbin# cat a3.pl
my $str="UPDATE QRTZ_SCHEDULER_STATE SET";
my $a="$ARGV[0]";
my $b="$ARGV[1]";
if ($str=~/$a\s+$b/i ){print "111111111\n"};
if ($str=~/$a\s+`zjzc`.`$b`/i ){print "22222222\n"};
wjdb3:/root/sbin# perl a3.pl UPDATE QRTZ_SCHEDULER_STATE
111111111
\s Match a whitespace character 匹配空白字符
wjdb3:/root/sbin# cat a3.pl
my $str="UPDATE `zjzc`.`QRTZ_SCHEDuler_state`";
my $a="$ARGV[0]";
my $b="$ARGV[1]";
if ($str=~/$a\s+$b/i ){print "111111111\n"};
if ($str=~/$a\s+`zjzc`.`$b`/i ){print "22222222\n"};
wjdb3:/root/sbin# perl a3.pl UPDATE QRTZ_SCHEDULER_STATE
22222222
转载于:https://www.cnblogs.com/zhaoyangjian724/p/6199301.html