#!/usr/local/bin/expect -f #!expect -f $1 $2 set hostid [lrange $argv 1 1] set retfil [lrange $argv 2 2] spawn kermit sleep .4 send -s -- "set protocol zmodem {rz -E} {rz -E} {sz --zmodem --delay-startup 10 -e -w 2048 %s} {sz -a %s} {rz -E} {rz -E}\r" send -s -- "telnet $hostid\r" -exact " Do you want to send a file? Y/\[N\]: " { sleep .2 send -s -- "y\r" expect -exact " Enter an upload command to your modem program now." sleep 5 send -s -- "\034\003" send -s -- "send $retfil\r" send -s -- "c\r" }