home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2420 < prev    next >
Internet Message Format  |  1990-12-28  |  1KB

  1. From: news@m2xenix.psg.com (Randy Bush)
  2. Newsgroups: alt.sources
  3. Subject: Re: Smail3 log file parser
  4. Message-ID: <1990Dec27.001457.9499@m2xenix.psg.com>
  5. Date: 27 Dec 90 00:14:57 GMT
  6.  
  7. [ in alt.sources because it contains a shell script to accomplish the same task
  8.   as a previous posting ]
  9.  
  10. jeff@onion.pdx.com (Jeff Beadles) writes:
  11.  
  12. > What this program will do is simple.  It will take the smail3 logfile
  13. > information, and produce a fairly human-readable report.
  14.  
  15. Your C code went infinite over here on Xenix/386 (after hacking rindex).  But
  16. m2xenix's smail log has about 1k messages per day, and the matching entries can
  17. be quite separated (I've see a hundred lines) as smail runs -q5m.
  18.  
  19. I have been using the following sort/awk hack to accomplish the same.  But it
  20. goes a bit grotty with mailing lists and mail gated to a newsgroup via inews.
  21.  
  22. - - - - - - - - - - - - - -   c u t   h e r e   - - - - - - - - - - - - - -
  23.  
  24. sort +2 -3 < /spool/smail/log/logfile | awk '
  25. {  if ($4 == "new") printf ("%s %s => ", $2, $7)
  26.    else if ($6 == "delivered") print ($4) }' | sort
  27.  
  28. - - - - - - - - - - - - - -   c u t   h e r e   - - - - - - - - - - - - - -
  29.  
  30. So, what a fellow smailer at a more anal site wants now is a bytecount per
  31. sender and recipient.
  32.  
  33. And now we should be hearing from the perl hackers.  Or will the INTERCAL
  34. -- 
  35. ..!{uunet,qiclab,intelhf,bucket}!m2xenix!news
  36.