home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-User.iso / usr / lib / transcript / psint.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1997-03-29  |  3KB  |  88 lines

  1. #!/bin/sh
  2. # 4.2BSD line printer spooler interface for PostScript/TranScript printer
  3. # this is the printcap/lpd-invoked top level filter program for ALL file types
  4. # Copyright (c) 1985,1987,1990 Adobe Systems Incorporated. All Rights Reserved. 
  5. # GOVERNMENT END USERS: See Notice file in TranScript library directory
  6. # -- probably /usr/lib/ps/Notice
  7. # RCSID: $Header: /disks/hobo/vp6/snichols/rel3.0/transcript/lib/RCS/psint.bsd,v 3.0 1991/06/17 17:08:31 snichols Exp $
  8.  
  9. PATH=/bin:/usr/bin:/usr/ucb
  10. export PATH
  11.  
  12. # set up initial undefined variable values
  13. width= length= indent= login= host= afile=
  14. prog=$0
  15. cwd=`pwd`
  16. pname=`basename $cwd`
  17.  
  18. # Some versions of Unix save up all entries to the log until the job is
  19. # done.  The exec command commented out below causes all entries to the log
  20. # to be written to the log as they occur.  If you desire this behavior,
  21. # remove the comment from this line, and put in the appropriate file name
  22. # for the log file.
  23. #
  24. # exec 2>>/usr/adm/printers/${pname}-log
  25. #
  26.  
  27. # define the default printer-specific and TranScript
  28. # configuration options, these may be overridden by
  29. # real printer-specific options in the .options file
  30.  
  31. PSLIBDIR=/usr/lib/transcript
  32. REVERSE=
  33. VERBOSELOG=1
  34. BANNERFIRST=0
  35. BANNERLAST=0
  36. BANNERPRO=$PSLIBDIR/banner.pro
  37. PSCOMM=$PSLIBDIR/pscomm
  38. PSDMAN=$PSLIBDIR/psdman
  39. export PSLIBDIR VERBOSELOG BANNERFIRST BANNERLAST BANNERPRO REVERSE
  40.  
  41. # load the values from the .options file if present
  42. test -r ./.options && . ./.options
  43.  
  44. # parse the command line arguments, most get ignored
  45. # the -hhost vs. -h host is due to one report of someone doing it wrong.
  46. # you could add or filter out non-standard options here (-p and -f)
  47.  
  48. while test $# != 0
  49. do    case "$1" in
  50.     -c)    ;;
  51.     -w*)    width=$1 ;;
  52.     -l*)    length=$1 ;;
  53.     -i*)    indent=$1 ;;
  54.     -x*)    width=$1 ;;
  55.     -y*)    length=$1 ;;
  56.     -n)    user=$2 ; shift ;;
  57.     -n*)    user=`expr $1 : '-.\(.*\)'` ;;
  58.     -h)    host=$2 ; shift ;;
  59.     -h*)    host=`expr $1 : '-.\(.*\)'` ;;
  60.     -*)    ;; 
  61.     *)    afile=$1 ;;
  62.     esac
  63.     shift
  64. done
  65.  
  66. PATH=$PSLIBDIR:$PATH
  67. export PATH
  68.  
  69. # now exec the format-specific filter, based on $prog
  70. # if - communications filter [default]
  71. # of - banner filter [execed directly]
  72. # nf - ditroff, tf - troff (CAT), gf - plot
  73. # vf - raster, df - TeX DVI, cf - cifplot, rf - fortran
  74.  
  75. prog=`basename $prog`
  76. comm="$PSCOMM -P $pname -p $prog -n $user -h $host $afile"
  77. dman="$PSDMAN -P $pname -p $prog -n $user -h $host $afile"
  78.  
  79. case $prog in
  80.     psif) $dman | $comm ;;
  81.     psof) exec psbanner $pname ; exit 0 ;;
  82.     psnf) psdit | $dman | $comm ;;
  83.     pstf) pscat | $dman | $comm ;;
  84.     psgf) psplot | $dman | $comm ;;
  85.     psvf|pscf|psdf|psrf) echo "$prog: filter not available." 1>&2  ;
  86.             psbad $prog $pname $user $host | $comm ;;
  87. esac
  88.