home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / mail / mh / 978 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  2.9 KB

  1. Xref: sparky comp.mail.mh:978 comp.mail.elm:2014
  2. Path: sparky!uunet!mcsun!Germany.EU.net!unido!sapwdf!wohler
  3. From: wohler@sapwdf.UUCP (Bill Wohler)
  4. Newsgroups: comp.mail.mh,comp.mail.elm
  5. Subject: Re: Urgent request
  6. Keywords: convert, inc, spool, elm, mh
  7. Message-ID: <3743@sapwdf.UUCP>
  8. Date: 28 Jul 92 09:47:37 GMT
  9. References: <4#qxgx#@rpi.edu> <nhu3u04@fido.asd.sgi.com>
  10. Reply-To: Bill Wohler <wohler@sap-ag.de>
  11. Organization: SAP AG, Walldorf, Germany
  12. Lines: 78
  13.  
  14. shankar@sgi.com (Shankar Unni) writes:
  15. >In article <4#qxgx#@rpi.edu> lingy@rpi.edu writes:
  16. >>8( Can any kind soul please help me get it back into the old format as 
  17. >>I do not like to use mh (not that it's bad, but I just don't have the time
  18. >>to learn it and I am quit happy with Elm until I learn mh and get a nice
  19. >>Elm-like front-end for it)
  20.  
  21. >I have a script for this, which I am posting, since others may find it
  22. >useful as well:
  23.  
  24.   to save yourself time in the future and to reduce newsgroup traffic,
  25.   don't bother with a followup when the answer is in the faq: i
  26.   *always* send a reply to people who post faq's.  in this case, the
  27.   faq solution is also *much* shorter and doesn't require ksh or a
  28.   special awk (see below).  in other cases, i heartily enjoy receiving
  29.   e-mail with new information and critiques about the FAQ.
  30.  
  31.   
  32.   if you cannot find the FAQ on your system, you can obtain it
  33.   yourself.  the FAQ can be ftped:
  34.   
  35.   pit-manager.mit.edu    [18.72.1.58]    /pub/usenet/news.answers/mh-faq
  36.                     /pub/usenet/news.answers/nn-faq
  37.  
  38.   if you don't have FTP access, you can request a copy of the FAQ by
  39.   sending mail to mail-server@pit-manager.mit.edu containing one (or
  40.   both) of the following:
  41.   
  42.     send usenet/news.answers/mh-faq
  43.     send usenet/news.answers/nn-faq
  44.  
  45.  
  46. Subject: Can I append MH messages (ie. +inbox/1) to a UNIX mailbox format file?
  47. From: Using MH-24 
  48.   
  49.   #! /bin/sh
  50.   # packmbox - pack an MH folder back into a UUCP-style mbox
  51.   #
  52.   # Defaults:
  53.   #    `+folder'    defaults to current folder
  54.   #    `msgs'     defaults to all
  55.   #
  56.   # Context:
  57.   #    Current-Folder
  58.   #
  59.   # for simplicity (and speed) we don't parse command-line args (much)
  60.   case $#/$1 in
  61.      1/-h*) echo "syntax: packmbox [+folder] [msgs] [-help]" 1>&2; exit 0;;
  62.   esac
  63.   
  64.   format="%(msg) From \
  65.   %<{return-path}%(putstr)%|\
  66.   %<(nonnull(mbox{from}))%(putstr)%|nobody%>@\
  67.   %<(nonnull(host{from}))%(putstr)%|nowhere%>%> \
  68.   %(day{date}) %(month{date}) %2(mday{date}) \
  69.   %02(hour{date}):%02(min{date}):%02(sec{date}) \
  70.   %(void(year{date}))%<(gt 100)%4(putnum)%|19%02(putnum)%>"
  71.   
  72.   trap 'rm -f /tmp/packm$$; exit 1' 1 2 3 15
  73.   
  74.   scan -noclear -noheader -noreverse -width 256 \
  75.               -format "${format}" $* >/tmp/packm$$
  76.   # tricky -- you must do this "cd" after scan has updated the context
  77.   cd `mhpath`
  78.   
  79.   exec </tmp/packm$$
  80.   rm -f /tmp/packm$$
  81.   while read m f
  82.   do
  83.       echo "$f"
  84.       sed -e '/^From /s/^/>/' < $m
  85.       echo ""
  86.   done
  87.   exit
  88.   
  89.  
  90. Bill Wohler <wohler@sap-ag.de> <sapwdf!wohler>
  91. Heidelberg Red Barons Ultimate Frisbee Team
  92.