tgeneric - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
tgeneric (586B)
---
1 #!/usr/local/plan9/bin/rc
2 if (! ~ $DEBUG '') flag x +
3
4 if (~ $THIS_HOST $DEST_HOST) {
5 if (test -f $LPLIB/log/$LPDEST^.st) {
6 echo status:
7 tail -3 $LPLIB/log/$LPDEST^.st
8 }
9 cd $LPSPOOL
10 if (test -d $LPDEST) {
11 once=''
12 for (i in `{lpsub sched $SCHED $LPDEST}) {
13 if (~ $once '') {
14 echo
15 echo queue on $THIS_HOST:
16 echo 'job user try size'
17 once=1
18 }
19 STATLINE=`{cat $LPDEST/$i^id}
20 LSLINE=`{ls -l $LPDEST/$i}
21 echo $STATLINE(1)^$STATLINE(3)' '$STATLINE(2)' '$STATLINE(4)' '$LSLINE(6)
22 }
23 }
24 }
25 if not {
26 { echo -d$LPDEST -q; sleep 5 } | lpsend $DEST_HOST
27 }