gspipe 434 B

123456789101112131415161718192021222324
  1. #!/bin/rc
  2. if (! ~ $DEBUG '') flag x +
  3. # usage: gspipe [dev]
  4. # assumes postscript on stdin
  5. switch($#*) {
  6. case 0
  7. GSDEVICE=`{echo $LPCLASS | sed 's/(.*\+)?gs!([^+]*)(\+.*)?/\2/'}
  8. case 1
  9. GSDEVICE=$1
  10. case *
  11. echo 'usage: gspipe [dev]' >[1=2]
  12. exit gspipe
  13. }
  14. GSTMPFILE=/tmp/gsp^$pid
  15. GSOPT=('-sDEVICE='^$GSDEVICE '-sOUTPUTFILE='$GSTMPFILE -dSAFER -dNOPAUSE -dQUIET -dBATCH)
  16. gs $GSOPT - >/dev/null
  17. cat $GSTMPFILE
  18. rm -f $GSTMPFILE
  19. exit