0%

dns测试脚本

1
2
3
4
5
6
7
8
9
10
11
var=1
while true ; do
res=$( { curl -o /dev/null -s -w %{time_namelookup}\\n http://crypto-hsm-svc.utils:8080; } 2>&1 )
var=$((var+1))
if [[ $res =~ ^[1-9] ]]; then
now=$(date +"%T")
echo "$var slow: $res $now"
break
fi
done

数据合并统计

1
awk 'NR==FNR { a[$1,$2]=$0; next } {  if (($2,$3) in a) { print a[$2,$3]; found = 1 } else { print a[$2,$3]; found = 0 } }'  b.txt a.txt    > c.txt

获取差异值

1
awk 'NR==FNR { a[$2,$3]=$0; next } {  if (($1,$2) in a) {  found = 1 } else { print $0; found = 0 } }'  a.txt b.txt