#!/bin/sh
#
#
# Usage: print <-P printer> filename

#
# Set site-specific variables here
#
PRINTER="-Plw"

#
# process everything
#

case $1 in
     -P)
       PRINTER="-P $1"
       FILE=$3;;
     -P*)
       PRINTER="$1"
       FILE=$2;;
     *)
       FILE=$1;;
esac

EQN=deqn
TBL=dtbl
GRN="grn $PRINTER"
LPRCMD="lpr $PRINTER"
TROFF="psroff -me $PRINTER"
PIC=pic

case $FILE in
      *.me)
          $TBL $FILE | $PIC | $EQN | $TROFF;;
      *.ps)
          $LPRCMD $PRINTER < $FILE;;
      *.doc)
          $LPRCMD $PRINTER < $FILE;;
	  *)
		  echo "print: File $FILE has an unknown extension."
esac
