home *** CD-ROM | disk | FTP | other *** search
- ;
- ; GETBIN.CMD by Prof. Timo Salmi, ts@chyde.uwasa.fi, Thu 21-12-1989
- ; A script to get a binary file from a Unix host to your PC
- ;
- ; To run getbin.cmd script give kermit command:
- ; take getbin.cmd [filename]
- ; Or if you have run take zset.cmd then just give kermit command:
- ; getbin [filename]
- ;
- ; Error handling
- def errstop echo \%1\7\13, define \%1, stop
- if not defined \%1 ask \%f Get which binary file?
- if defined \%1 define \%f \%1
- if not defined \%f errstop {Error: You have not defined the filename variable}
- ;
- set take-echo on ;Show what is happening
- clear ;Clear the input buffer
- set parity even ;CHANGE as your system might require
- set receive packet 1000 ;Use long packets
- set take-echo off ;Enough of displaying the comments
- ;
- pause 1 ;Let's not be too hasty about it :-)
- output kermit\13 ;Invoke Unix C-kermit
- pause 1
- output set file type binary\13 ;E.g. if it is and .arc file
- pause 1
- output set parity even\13 ;CHANGE as your system might require
- pause 1
- output set send packet 1000\13 ;Use long packets (C-Kermit)
- pause 1
- output send \%f\13 ;Start sending the file from host
- pause 1
- ;
- input 5 ?File not found ;Check that host has the file
- if fail goto label1
- echo \13Host reported an error\7\7\7\7\7\13
- echo \13
- goto label2 ;Don't try to receive
- ;
- :LABEL1
- receive f:\ ;Where to put the file in your PC
- ; ; change the path as applicable
- :LABEL2
- pause 5 ;A longer pause is required here
- output quit\13 ;Quit host kermit
- pause 1
- define \%f ;Release filename
- define \%1 ;Release parameter
- pause 1
- echo \13Script GETBIN.CMD by Prof. Timo Salmi, Done
-