doc3.awk

来自「早期freebsd实现」· AWK 代码 · 共 34 行

AWK
34 行
字号
## doc3.awk##      Distributed with:  Doc - Version 2.0 (8/22/90)#      USC Information Sciences Institute## Accepts as input, output from dig querying for NS records of a# domain.  Expects input to include TTLs and to be all lower case.## Prints list of machines which are nameserves for the domain.# Also crunches following info into the 8 bit unix exit code:##    o response was authoritative (or not)#    o number of unique TTLs associated with NS records#    o number of A records found for domain names found to be servers#BEGIN {aa=0; glue=0; ttl=0}/flags:/ && /aa/ {aa++}$4=="ns" {print $5; a[$5]=1; if (zttl[$2]++ == 0) ttl++}$4=="a" {if (a[$1]++ == 1) glue++}END {  j = glue;  j = j + 16 * ttl;  if (aa)     j = j - 127;   exit(j)}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?