Plan 9 from Bell Labs’s /usr/web/sources/contrib/akumar/gs/gspipeijs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# extended to IJS driver by K.Okamoto
# duble-sided printing for PSC 2550 printer
#
if (! ~ $DEBUG '') flag x +

# usage: gspipeijs [dev]
# assumes postscript on stdin

switch($#*) {
case 0
	MODEL=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)(\+.*)?/\2/'}
	NUMBER=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)\+(.*)?/\3/'}
case 1
	IJS=$1
case *
	echo 'usage: gspipeijs [dev]' >[1=2]
	exit gspipeijs
}

GSTMPFILE=/tmp/gsp$pid

GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -DBATCH)

switch($NUMBER) {
case 2100
	GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -DBATCH)
case 2500
	GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -dDuplex'='true -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -DBATCH)
}

gs $GSOPT  - 

cat $GSTMPFILE
rm $GSTMPFILE

exit

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.