home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / unix / paintps.sha / maclaser.csh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1986-07-08  |  1.6 KB  |  49 lines

  1. #! /bin/csh -f
  2.  
  3. # A simple script to spool files prepared on a Macintosh for printing on
  4. # the LaserWriter.  It expilictly spools to the lw printer and flags the
  5. # file as "Fortran" type.  This file type is redefined locally to mean
  6. # a mac Postscript file, causing the Apple laser-prep file to be prepended
  7. # to provide the standard Mac environment in the printer when the file
  8. # is processed.
  9. # Files spooled with maclaser should have been created on the Mac with
  10. # the COMMAND-F sequence and the resulting PostScript file uploaded  [RH]
  11. #
  12. #  April 1986    Generalized to handle arbitrary option args and accept
  13. #        multiple file names.  This is now a general filter for
  14. #        calling lpr.  Options and file names can be mixed up in
  15. #        the "wrong" order and they will be given to lpr in the 
  16. #        order it wants them.  The 'always' variable is what makes
  17. #        this a script specific to handling Mac Postscript.
  18. #        Ron Hitchens (hitchens@sally), Brian Powell (brian@sally)
  19. #
  20.  
  21. set lpr = /usr/ucb/lpr
  22. set lw = -Plw
  23. set always = (-f)        # this means Mac PostScript (local spooler hack)
  24. set flags = ()
  25. set files = ()
  26.  
  27. top:
  28.     if ($#argv > 0) then
  29.         switch ($argv[1])
  30.         case -P*:        # need to look for this one specifically
  31.             set lw=$argv[1]    # since we've setup a default
  32.             shift argv
  33.             goto top
  34.         case -:            # pretend this means read stdin
  35.             shift argv    # lpr reads stdin if no files names
  36.             goto top    # are given anyway.  Ignore it.
  37.         case -*:
  38.             set flags = ($flags $argv[1])
  39.             shift argv
  40.             goto top
  41.         default:
  42.             set files = ($files $argv[1])
  43.             shift argv
  44.             goto top
  45.         endsw
  46.     endif
  47.  
  48. exec $lpr $always $lw $flags $files
  49.