home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / mail / mh / 1467 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!ames!olivea!sgigate!odin!mithras.boston.sgi.com!rc
  2. From: rc@mithras.boston.sgi.com (Roger Corron)
  3. Newsgroups: comp.mail.mh
  4. Subject: Fixed prune-mail script
  5. Message-ID: <1993Jan7.142744.15699@odin.corp.sgi.com>
  6. Date: 7 Jan 93 14:27:44 GMT
  7. Sender: news@odin.corp.sgi.com (Net News)
  8. Reply-To: rc@boston.sgi.com
  9. Organization: Silicon Graphics, Inc.
  10. Lines: 38
  11. Nntp-Posting-Host: mithras.boston.sgi.com
  12.  
  13. Mail to Bob Munck (the author) bounces, and this is probably of general
  14. interest, so...
  15.  
  16. This is a fix to the prune-mail script distributed from ftp.ics.uci.edu.
  17. The original could delete messages that did not have any message-id,
  18. such as a message filed with Fcc. If there were multiple such messages
  19. in a folder, one would be selected from the scan output and deleted.
  20. A grep for "<" and ">" solves the problem.
  21.  
  22. Roger Corron
  23. rc@boston.sgi.com
  24.  
  25. #! /bin/csh -f
  26. # eliminate all messages in $1 with duplicate message-ids
  27. #
  28. # Subject: MH utility to delete duplicate messages in a folder
  29. # Date: Wed, 19 Aug 92 11:48:45 -0400
  30. # From: Bob Munck <munck@Stars.Reston.Unisys.COM>
  31. # Fixed to delete only messages with message-ids.
  32. # Roger Corron  <rc@boston.sgi.com>
  33. #
  34. # I debated using "$1" everywhere I have "+$1", since the user
  35. # would then need the "+" and would be following MH conventions
  36. # more closely.  I suppose a real convention-following utility
  37. # would also allow defaulting by using Path from ~/.mh-profile
  38. # to find context and getting Current-Folder from it.  
  39.  
  40. if ( ( $#argv == 0 ) || ( $1 == -help ) || ( $1 == -h ) ) then
  41.    echo 'USAGE: prune-mail folder'
  42.    exit 0
  43.    endif
  44. folder +$1
  45. set s =  `scan +$1 -format "%4(putnumf(msg))    %{message-id}"|grep '.*<.*>.*' | sort +1|uniq -d +5|sed 's/    .*$//'`
  46. if ( "$s" != "" ) then
  47.    rmm $s +$1
  48.    folder +$1
  49.    endif
  50.