source: trunk/third/transcript/lib/psint.bsd @ 9090

Revision 9090, 2.7 KB checked in by ghudson, 28 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r9089, which included commits to RCS files with non-trunk default branches.
  • Property svn:executable set to *
Line 
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,1992 Adobe Systems Incorporated. All Rights
5# Reserved. 
6# GOVERNMENT END USERS: See Notice file in TranScript library directory
7# -- probably /usr/lib/ps/Notice
8# RCSID: $Header: /afs/dev.mit.edu/source/repository/third/transcript/lib/psint.bsd,v 1.1.1.1 1996-10-07 20:25:32 ghudson Exp $
9
10BINDIR=XBINDIRX
11PATH=$BINDIR:/bin:/usr/bin:/usr/ucb
12export PATH
13
14# set up initial undefined variable values
15width= length= indent= login= host= afile=
16prog=$0
17cwd=`pwd`
18pname=`basename $cwd`
19
20# Some versions of Unix save up all entries to the log until the job is
21# done.  The exec command commented out below causes all entries to the log
22# to be written to the log as they occur.  If you desire this behavior,
23# remove the comment from this line, and put in the appropriate file name
24# for the log file.
25#
26# exec 2>>XLOGDIRX/${pname}-log
27#
28
29# define the default printer-specific and TranScript
30# configuration options, these may be overridden by
31# real printer-specific options in the .options file
32
33PSLIBDIR=XPSLIBDIRX
34REVERSE=XREVERSEX
35VERBOSELOG=XVERBOSELOGX
36BANNERFIRST=XBANNERFIRSTX
37BANNERLAST=XBANNERLASTX
38BANNERPRO=$PSLIBDIR/banner.pro
39PSCOMM=$PSLIBDIR/pscomm
40PSDMAN=$PSLIBDIR/psdman
41export PSLIBDIR VERBOSELOG BANNERFIRST BANNERLAST BANNERPRO REVERSE
42
43# load the values from the .options file if present
44test -r ./.options && . ./.options
45
46# parse the command line arguments, most get ignored
47# the -hhost vs. -h host is due to one report of someone doing it wrong.
48# you could add or filter out non-standard options here (-p and -f)
49
50while test $# != 0
51do      case "$1" in
52        -c)     ;;
53        -w*)    width=$1 ;;
54        -l*)    length=$1 ;;
55        -i*)    indent=$1 ;;
56        -x*)    width=$1 ;;
57        -y*)    length=$1 ;;
58        -n)     user=$2 ; shift ;;
59        -n*)    user=`expr $1 : '-.\(.*\)'` ;;
60        -h)     host=$2 ; shift ;;
61        -h*)    host=`expr $1 : '-.\(.*\)'` ;;
62        -*)     ;;
63        *)      afile=$1 ;;
64        esac
65        shift
66done
67
68PATH=$PSLIBDIR:$PATH
69export PATH
70
71# now exec the format-specific filter, based on $prog
72# if - communications filter [default]
73# of - banner filter [execed directly]
74# nf - ditroff, tf - troff (CAT), gf - plot
75# vf - raster, df - TeX DVI, cf - cifplot, rf - fortran
76
77prog=`basename $prog`
78comm="$PSCOMM -P $pname -p $prog -n $user -h $host $afile"
79dman="$PSDMAN -P $pname -p $prog -n $user -h $host $afile"
80
81case $prog in
82        psif) $dman | $comm ;;
83        psof) exec psbanner $pname ; exit 0 ;;
84        psnf) psdit | $dman | $comm ;;
85        pstf) pscat | $dman | $comm ;;
86        psgf) psplot | $dman | $comm ;;
87        psvf|pscf|psdf|psrf) echo "$prog: filter not available." 1>&2  ;
88                        psbad $prog $pname $user $host | $comm ;;
89esac
Note: See TracBrowser for help on using the repository browser.