aboutsummaryrefslogtreecommitdiff
path: root/lp/spooler/nospool
blob: 4d019983e6103266e6537e32e276a823c3e63dbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/local/plan9/bin/rc
if (! ~ $DEBUG '') flag x +

if (~ $LPCLASS *sendEOT*) SENDEOT=1
if not SENDEOT=0

if (~ $OUTDEV -) OUTDEV=/dev/stdout
if (~ $#* 0) {
	if (! ~ $DEBUG '') echo input file is stdin >[1=2]
	lpsub process $LPPROC >$OUTDEV
	if (~ $SENDEOT 1) echo -n `{ascii -t 4} > $OUTDEV
}
if not {
	if (! ~ $DEBUG '') echo input files $* >[1=2]
	for (i in $*) {
		if (! ~ $DEBUG '') echo processing $i >[1=2]
		lpsub process $LPPROC < $i  > $OUTDEV
		if (~ $SENDEOT 1) echo -n `{ascii -t 4} > $OUTDEV
	}
}
exit ''