Blob


1 #!/usr/local/plan9/bin/rc
2 if (! ~ $DEBUG '') flag x +
4 if (~ $LPCLASS *sendEOT*) SENDEOT=1
5 if not SENDEOT=0
7 if (~ $OUTDEV -) OUTDEV=/dev/stdout
8 if (~ $#* 0) {
9 if (! ~ $DEBUG '') echo input file is stdin >[1=2]
10 lpsub process $LPPROC >$OUTDEV
11 if (~ $SENDEOT 1) echo -n `{ascii -t 4} > $OUTDEV
12 }
13 if not {
14 if (! ~ $DEBUG '') echo input files $* >[1=2]
15 for (i in $*) {
16 if (! ~ $DEBUG '') echo processing $i >[1=2]
17 lpsub process $LPPROC < $i > $OUTDEV
18 if (~ $SENDEOT 1) echo -n `{ascii -t 4} > $OUTDEV
19 }
20 }
21 exit ''