1#!/bin/rc 2# send PostScript jobs to the spooler in the MHCC 3# Request is made for bin and account numbers for each file (for typing pool). 4 5if (! ~ $DEBUG '') flag x + 6FONTLIST=lw+ 7if (test -r /sys/lib/postscript/font/$LPDEST) FONTLIST=$LPDEST 8 9switch ($LPCLASS) { 10case *duplex*; DUPLEX=-s2 11case ''; DUPLEX='' 12} 13HOLE='' 14STAPLE='-KSTAPLES\ n' 15TRAY='' 16 17if (~ $IBIN vg view viewgr*;) $VGS=-fvg 18if (~ $IBIN *hole*) HOLE=-fhole 19if (~ $IBIN *staple*) STAPLE='' 20if (~ $IBIN *simplex*) DUPLEX='' 21if (~ $IBIN *11x17* *ledger*) TRAY='-KTRAY\ 11x17tray' 22 23if (~ $LAND '' -pport) LAND=-pport 24if not LAND=-pland 25i=0 26if (~ $#* 0) *='' 27for (j) { 28 i=`{echo $i + 1 | hoc} 29# check access to the file so that you know that a failure in the 30# processing is a drastic error which will cause an exit from lp. 31 32 if (~ $j '' || test -f $j) { 33 while (~ $#ACCOUNT 0 || ~ $ACCOUNT '' *0000) { 34 echo -n 'account=' >/dev/cons 35 ACCOUNT = (`{read</dev/cons}) 36 } 37 while (~ $#BIN 0 || ~ $BIN '' *000) { 38 echo -n 'bin=' >/dev/cons 39 BIN = (`{read</dev/cons}) 40 } 41 switch ($j) { 42 case ''; @{ bind -b $LPLIB/process /bin; $LPPROC } | 43 /sys/lib/postscript/bin/$cputype/download -f -H/sys/lib/postscript/font -mfontmap -p$FONTLIST | 44 {echo -K'ACCTNUM\ '$ACCOUNT -K'BIN\ '$BIN -d$LPDEST -c$COPIES -lpostscript $VGS $HOLE $STAPLE $DUPLEX $LAND $TRAY -u$LPUSERID -j$LPMACHID$pid.$i 45 cat} | lpsend.rc $DEST_HOST 46 case *; @{ bind -b $LPLIB/process /bin; $LPPROC } < $j | 47 /sys/lib/postscript/bin/$cputype/download -f -H/sys/lib/postscript/font -mfontmap -p$FONTLIST | 48 {echo -K'ACCTNUM\ '$ACCOUNT -K'BIN\ '$BIN -d$LPDEST -c$COPIES -lpostscript $VGS $HOLE $STAPLE $DUPLEX $LAND $TRAY -u$LPUSERID -j$LPMACHID$pid.$i 49 cat $j} | lpsend.rc $DEST_HOST 50 } 51 } 52} 53