home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / trn / part01 / mbox.saver.SH < prev    next >
Encoding:
Text File  |  1991-12-02  |  1.8 KB  |  66 lines

  1. case $CONFIG in
  2.     '') . ./config.sh ;;
  3. esac
  4. echo "Extracting mbox.saver (with variable substitutions)"
  5. $spitshell >mbox.saver <<!GROK!THIS!
  6. $startsh
  7. # $Id: mbox.saver.SH,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  8. # $Log: mbox.saver.SH,v $
  9. # Revision 4.4  1991/09/09  20:23:31  sob
  10. # release 4.4
  11. #
  12. # This software is Copyright 1991 by Stan Barber. 
  13. #
  14. # Permission is hereby granted to copy, reproduce, redistribute or otherwise
  15. # use this software as long as: there is no monetary profit gained
  16. # specifically from the use or reproduction of this software, it is not
  17. # sold, rented, traded or otherwise marketed, and this copyright notice is
  18. # included prominently in any copy made. 
  19. #
  20. # The author make no claims as to the fitness or correctness of this software
  21. # for any use whatsoever, and it is provided as is. Any use of this software
  22. # is at the user's own risk. 
  23. #    Arguments:
  24. #    1 Full name of article (%A)
  25. #    2 Public news spool directory (%P)
  26. #    3 Directory of current newsgroup (%c)
  27. #    4 Article number (%a)
  28. #    5 Where in article to start (%B)
  29. #    6 Newsgroup name (%C)
  30. #    7 Save destination (%b)
  31. #    8 First line of message, normally From...
  32. #
  33. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  34.  
  35. !GROK!THIS!
  36. case $mboxchar in
  37. "$CTRLA")
  38.     $spitshell >>mbox.saver <<!GROK!THIS!
  39. ( $echo "$CTRLA$CTRLA$CTRLA$CTRLA"
  40.   if $test "\$5" = 0 -a ! "\$4" = 0 ; then
  41.     $echo "Article: \$4 of \$6"
  42.   fi
  43.   $tail +\$5c \$1
  44.   $echo ""
  45.   $echo ""
  46.   $echo "$CTRLA$CTRLA$CTRLA$CTRLA" ) >> \$7
  47. !GROK!THIS!
  48.     ;;
  49. *)
  50.     $spitshell >>mbox.saver <<!GROK!THIS!
  51.  ( $echo "\$8"
  52.   if $test "\$5" = 0 -a ! "\$4" = 0 ; then
  53.     $echo "Article: \$4 of \$6"
  54.   fi
  55.   $tail +\$5c \$1 | $sed "s/^From />From /"
  56.   $echo ""
  57.   $echo "" ) >> \$7
  58. !GROK!THIS!
  59.     ;;
  60. esac
  61. $eunicefix mbox.saver
  62. chmod 755 mbox.saver
  63.