shithub: riscv

ref: 1b09060f468f530af2f4ef75441a40084e912e54
dir: /sys/lib/lp/spooler/nospool/

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

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

if (~ $OUTDEV -) OUTDEV=/fd/1
if (~ $#* 0) {
	if (! ~ $DEBUG '') echo input file is stdin >[1=2]
	@{bind -b $LPLIB/process /bin; $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]
		@{bind -b $LPLIB/process /bin; $LPPROC} < $i  > $OUTDEV
		if (~ $SENDEOT 1) echo -n `{ascii -t 4} > $OUTDEV
	}
}
exit ''