home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre2.z / postgre2 / doc / print < prev    next >
Encoding:
Text File  |  1992-08-27  |  604 b   |  43 lines

  1. #!/bin/sh
  2. #
  3. #
  4. # Usage: print <-P printer> filename
  5.  
  6. #
  7. # Set site-specific variables here
  8. #
  9. PRINTER="-Plw"
  10.  
  11. #
  12. # process everything
  13. #
  14.  
  15. case $1 in
  16.      -P)
  17.        PRINTER="-P $1"
  18.        FILE=$3;;
  19.      -P*)
  20.        PRINTER="$1"
  21.        FILE=$2;;
  22.      *)
  23.        FILE=$1;;
  24. esac
  25.  
  26. EQN=deqn
  27. TBL=dtbl
  28. GRN="grn $PRINTER"
  29. LPRCMD="lpr $PRINTER"
  30. TROFF="psroff -me $PRINTER"
  31. PIC=pic
  32.  
  33. case $FILE in
  34.       *.me)
  35.           $TBL $FILE | $PIC | $EQN | $TROFF;;
  36.       *.ps)
  37.           $LPRCMD $PRINTER < $FILE;;
  38.       *.doc)
  39.           $LPRCMD $PRINTER < $FILE;;
  40.       *)
  41.           echo "print: File $FILE has an unknown extension."
  42. esac
  43.