Files
devops/perl/x.pl
2025-09-17 16:08:16 +08:00

41 lines
1.2 KiB
Perl
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

use strict;
use warnings;
while(<>){
chomp;
print "$1'|\n" if /(errorCode.{5,6}\d*)/;
}
#\"errorCode\": \"000\"
#\"errorCode\":\"0\"
#\"errorCode\":\"vss_error_003\"
#cat zuul-log.txt | perl -ne "print \"$1\n\" if /(errorCode.{5,6}\d*)/" | sort |uniq
#cat zuul-log.txt | perl -ne "print \"$1-$2\n\" if /(errorCode.+?\".+?\")(.+?)\\/"
#cat zuul-log.txt | perl -ne "print \"$1-$2\n\" if /(errorCode.+?\".+?\")(.+?)\\/"
#cat zuul-log.txt | perl -ne "print \"$1 : $2\n\" if /(errorCode).+?\".+?\"(.+?)\\/" | sort | uniq
## MAC OS
#cat zuul-log.txt | perl -ne 'print "$1 : $2\n" if /(errorCode).+?\".+?\"(.+?)\\/' | sort | uniq
# .+? - ? 非贪婪
# 1 符号含义
# 2 \n 换行
# 3 \r 回车
# 4 \t 制表符
# 5 \f formfeed
# 6 \b 退格
# 7 \a 响铃
# 8 \e escapeASCII 中的escape 字符)
# 9 \007 任何八进制值这里是007=bell(响铃)
#10 \x7f 任何十六进制值这里是007=bell
#11 \cC 一个控制符这里是ctrl +c
#12 \\ 反斜线
#13 \” 双引号
#14 \l 下个字符小写
#15 \L 接着的字符均小写直到\E
#16 \u 下个字符大写
#17 \U 接着的字符均大写直到\E
#18 \Q 在non-word 字符前加上\,直到\E
#19 \E 结束\L,\U 和\Q