Path: utzoo!utgpu!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!pdxgate!qiclab!m2xenix!news From: news@m2xenix.psg.com (Randy Bush) Newsgroups: alt.sources Subject: Re: Smail3 log file parser Message-ID: <1990Dec27.001457.9499@m2xenix.psg.com> Date: 27 Dec 90 00:14:57 GMT References: <1990Dec25.063653.14083@onion.pdx.com> Organization: Pacific Systems Group, Portland Oregon US Lines: 29 [ in alt.sources because it contains a shell script to accomplish the same task as a previous posting ] jeff@onion.pdx.com (Jeff Beadles) writes: > What this program will do is simple. It will take the smail3 logfile > information, and produce a fairly human-readable report. Your C code went infinite over here on Xenix/386 (after hacking rindex). But m2xenix's smail log has about 1k messages per day, and the matching entries can be quite separated (I've see a hundred lines) as smail runs -q5m. I have been using the following sort/awk hack to accomplish the same. But it goes a bit grotty with mailing lists and mail gated to a newsgroup via inews. - - - - - - - - - - - - - - c u t h e r e - - - - - - - - - - - - - - sort +2 -3 < /spool/smail/log/logfile | awk ' { if ($4 == "new") printf ("%s %s => ", $2, $7) else if ($6 == "delivered") print ($4) }' | sort - - - - - - - - - - - - - - c u t h e r e - - - - - - - - - - - - - - So, what a fellow smailer at a more anal site wants now is a bytecount per sender and recipient. And now we should be hearing from the perl hackers. Or will the INTERCAL -- ..!{uunet,qiclab,intelhf,bucket}!m2xenix!news