home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / emacs / help / 3716 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.7 KB  |  58 lines

  1. Path: sparky!uunet!usc!rpi!crdgw1!rdsunx.crd.ge.com!rdsunx!montnaro
  2. From: montnaro@spyder.crd.ge.com (Skip Montanaro)
  3. Newsgroups: gnu.emacs.help
  4. Subject: Re: Converting RMAIL files to Unix mbox format
  5. Message-ID: <MONTNARO.92Aug13104258@spyder.crd.ge.com>
  6. Date: 13 Aug 92 15:42:58 GMT
  7. References: <KATZ.92Aug11164350@carbon.elements.rpal.rockwell.com>
  8. Sender: usenet@crd.ge.com (Required for NNTP)
  9. Reply-To: montanaro@crd.ge.com (Skip Montanaro)
  10. Organization: GE Corporate Research & Development, Schenectady, NY
  11. Lines: 43
  12. In-Reply-To: katz@elements.rpal.rockwell.com's message of 11 Aug 92 21:43:50 GMT
  13. Nntp-Posting-Host: spyder.crd.ge.com
  14.  
  15.  
  16. In article <KATZ.92Aug11164350@carbon.elements.rpal.rockwell.com> katz@elements.rpal.rockwell.com (Morry Katz) writes:
  17.  
  18.    Does anybody have a program for converting RMAIL files to Unix mbox
  19.    format?
  20.  
  21. Time to post Nathan Hess's little shell script once again...
  22.  
  23. #!/bin/sh
  24. #
  25. # usage:    rmail-to-mail file1 file2 ...
  26. #
  27. # result:    file1~     is the original Babyl file
  28. #        file1      is an empty Babyl file
  29. #        file1.mail is a UNIX mail file with the messages from file1
  30.  
  31. cat > /tmp/$$.el << EOF
  32. ;;;
  33. ;;; Author:  Nathan Hess  (woodstock@hobbes.intel.com)
  34. ;;;
  35. ;;
  36.  
  37. (let ((file-to-be-converted (buffer-file-name))
  38.       (message-count 0)
  39.       (rmail-delete-after-output t)
  40.       (unix-style-file-name (concat (buffer-file-name) ".mail")))
  41.   (kill-buffer (current-buffer))
  42.   (rmail file-to-be-converted)
  43.   (rmail-show-message 1)
  44.   (while (not (rmail-output unix-style-file-name))
  45.     (setq message-count (1+ message-count)))
  46.   (rmail-quit))
  47. EOF
  48.  
  49. for f in "$@" ; do
  50.     echo ">>> Doing $f"
  51.     emacs -batch $f -l /tmp/$$.el -kill
  52.     echo ">>> Done"
  53. done
  54.  
  55. rm -f /tmp/$$.el
  56. --
  57. Skip (montanaro@crd.ge.com)
  58.