5 print "too few arguments, use:"
6 print "awk -f catcheck.awk <somemessage> <cd-file> <ct-file>"
13 # print "cdfile:", cdfile;
16 while ((getline line
<cdfile
) > 0)
26 split(line
, wrd
, "[ \t\r\n]");
27 # print "def: ", line, "w:", wrd[1];
28 def
[toupper(wrd
[1])]=
1;
32 # for(word in def) print "word: ", word, ";def: ", def[word];
33 # print "ctfile:", ctfile;
37 while ((getline line
<ctfile
) > 0)
47 split(line
, wrd
, "[ \t\r\n]");
48 # print "def: ",line,"w:", wrd[1];
49 if( def
[toupper(wrd
[1])]==
1 )
52 def
[toupper(wrd
[1])]=
2
64 if( def
[word
]==
1 ) print "-:" word
;
66 # print "cd:" countcd " ct:" countct " match:" countmatch;
67 # final output format: message "number of entries in CD" : "missing entries in CT" : "extra entries in CT"
68 print message countcd
":" countcd
-countmatch
":" countct
-countmatch
;