nospool 537 B

123456789101112131415161718192021
  1. #!/bin/rc
  2. if (! ~ $DEBUG '') flag x +
  3. if (~ $LPCLASS *sendEOT*) SENDEOT=1
  4. if not SENDEOT=0
  5. if (~ $OUTDEV -) OUTDEV=/fd/1
  6. if (~ $#* 0) {
  7. if (! ~ $DEBUG '') echo input file is stdin >[1=2]
  8. @{bind -b $LPLIB/process /bin; $LPPROC} > $OUTDEV
  9. if (~ $SENDEOT 1) echo -n `{ascii -t 4} > $OUTDEV
  10. }
  11. if not {
  12. if (! ~ $DEBUG '') echo input files $* >[1=2]
  13. for (i in $*) {
  14. if (! ~ $DEBUG '') echo processing $i >[1=2]
  15. @{bind -b $LPLIB/process /bin; $LPPROC} < $i > $OUTDEV
  16. if (~ $SENDEOT 1) echo -n `{ascii -t 4} > $OUTDEV
  17. }
  18. }
  19. exit ''