home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / vm / mh-to-vm.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1994-09-20  |  1.0 KB  |  38 lines

  1. #!/bin/sh
  2.  
  3. # Date: Thu, 9 Dec 93 18:23:56 -0500
  4. # From: kyle@crystal.WonderWorks.com (Kyle Jones)
  5. # To: lipp@networx.com
  6. # Cc: info-vm@uunet.uu.net
  7. # Subject: Converting MH folders to VM
  8. # Damon Lipparelli writes:
  9. #  > Does anyone have a way of converting MH folders to VM folders?  I've just
  10. #  > switched to using VM and I don't want to have to re-mail myself all of my
  11. #  > old mail messages stored with MH to get them into VM folders.
  12. # If I remember correctly MH folders are just directories, with one
  13. # message per file.  No UNIX From lines control-As or any of that
  14. # cruft.  So you need to roll these messages into one file that VM
  15. # can handle.  To get UNIX From style folders this script ought to
  16. # do it.  Run it like this
  17. # % mh-to-vm.sh MH-folder-directory new-VM-folder-file
  18. # It doesn't remove anything so if it doesn't work, then no harm done.
  19.  
  20. source=$1
  21. dest=$2
  22.  
  23. leader="From nobody `date`"
  24. trailer=""
  25.  
  26. for message in $source/*
  27. do
  28.    echo $leader >> $dest
  29.    sed 's/^From />From /' < $message >> $dest
  30.    echo $trailer >> $dest
  31. done
  32.  
  33. exit
  34.