home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / kermit / tskerm24.arc / GETBIN.CMD < prev    next >
Encoding:
Text File  |  1989-12-21  |  1.9 KB  |  51 lines

  1. ;
  2. ; GETBIN.CMD by Prof. Timo Salmi, ts@chyde.uwasa.fi, Thu 21-12-1989
  3. ; A script to get a binary file from a Unix host to your PC
  4. ;
  5. ; To run getbin.cmd script give kermit command:
  6. ;     take getbin.cmd [filename]
  7. ; Or if you have run take zset.cmd then just give kermit command:
  8. ;     getbin [filename]
  9. ;
  10. ; Error handling
  11. def errstop echo \%1\7\13, define \%1, stop
  12. if not defined \%1 ask \%f Get which binary file?
  13. if defined \%1 define \%f \%1
  14. if not defined \%f errstop {Error: You have not defined the filename variable}
  15. ;
  16. set take-echo on         ;Show what is happening
  17. clear                    ;Clear the input buffer
  18. set parity even          ;CHANGE as your system might require
  19. set receive packet 1000  ;Use long packets
  20. set take-echo off        ;Enough of displaying the comments
  21. ;
  22. pause 1                            ;Let's not be too hasty about it :-)
  23. output kermit\13                   ;Invoke Unix C-kermit
  24. pause 1                            
  25. output set file type binary\13     ;E.g. if it is and .arc file
  26. pause 1
  27. output set parity even\13          ;CHANGE as your system might require
  28. pause 1
  29. output set send packet 1000\13     ;Use long packets (C-Kermit)
  30. pause 1
  31. output send \%f\13                 ;Start sending the file from host
  32. pause 1
  33. ;
  34. input 5 ?File not found            ;Check that host has the file
  35. if fail goto label1
  36. echo \13Host reported an error\7\7\7\7\7\13
  37. echo \13
  38. goto label2                        ;Don't try to receive
  39. ;
  40. :LABEL1
  41. receive f:\                        ;Where to put the file in your PC
  42. ;                                  ; change the path as applicable
  43. :LABEL2
  44. pause 5                            ;A longer pause is required here
  45. output quit\13                     ;Quit host kermit
  46. pause 1
  47. define \%f                         ;Release filename
  48. define \%1                         ;Release parameter
  49. pause 1
  50. echo \13Script GETBIN.CMD by Prof. Timo Salmi, Done
  51.