home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / uucp / batch_msc94_v2.lha / batch_script next >
Encoding:
Text File  |  1994-01-21  |  931 b   |  37 lines

  1. .bra {
  2. .ket }
  3. .key machine/a,type/a
  4.  
  5. ; batchthem MSC94 09/01/94
  6. ; Not using UNIX commands.
  7. ; Should be portable.
  8. ; ARGS
  9. ;    machine should be the name of the remote machine
  10. ;    type should be the command to compress. Must support stdin/stdout
  11. ; EXAMPLES
  12. ;    batchthem samaris "gzip -9"
  13.  
  14. IF EXISTS UUSPOOL:BATCH/{machine}
  15.    set OUSERNAME $USERNAME
  16.    set USERNAME news
  17.  
  18.    Rename UUSPOOL:BATCH/{machine} UUSPOOL:BATCH/{machine}.$process
  19.    ; Previous line for multitasking security, Rename is atomic
  20.  
  21.    ; Creating ...
  22.    batch {machine}.$process T:batchthem.$process
  23.    echo > T:batchthem.c.$process "#! rnews" ; cunbatch worked for me
  24.    {type} < T:batchthem.$process >> T:batchthem.c.$process
  25.  
  26.    ; Sending ...
  27.    uux T:batchthem.c.$process "{machine}!cunbatch"
  28.  
  29.    ; Cleanup
  30.    Delete > NIL: T:batchthem(.|.c.)$process UUSPOOL:BATCH/{machine}.$process
  31.  
  32.    set USERNAME $OUSERNAME
  33.  
  34. ELSE
  35.    Echo "Nothing for {machine}"
  36. ENDIF
  37.