shithub: riscv

ref: 8b59286ef1d9bef6c2c7b248ab0b8072e25ec9cf
dir: /sys/lib/lp/process/gspipe/

View raw version
#!/bin/rc
if (! ~ $DEBUG '') flag x +

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

switch($#*) {
case 0
	GSDEVICE=`{echo $LPCLASS | sed 's/(.*\+)?gs!([^+]*)(\+.*)?/\2/'}
case 1
	GSDEVICE=$1
case *
	echo 'usage: gspipe [dev]' >[1=2]
	exit gspipe
}

GSTMPFILE=/tmp/gsp^$pid
GSOPT=('-sDEVICE='^$GSDEVICE '-sOUTPUTFILE='$GSTMPFILE -dSAFER -dNOPAUSE -dQUIET -dBATCH)

gs $GSOPT - >/dev/null 

cat $GSTMPFILE
rm -f $GSTMPFILE
exit ''