There is an excellent little zssh tool
there , which simplifies the use of a
lszrzutility to transfer files using
zmodem
over an existing ssh connection. This is surprisingly convenient ... but it seems that I must in order to accomplish the same thing using expect. I got it far ...
spawn ssh $argv
set ssh_spawn_id $spawn_id
send_user "ssh is: $ssh_spawn_id\n"
interact -o "\030B0000" {
send_user "\nStarting zmodem receive.\n"
spawn rz -v
set rz_spawn_id $spawn_id
send_user "rz is: $rz_spawn_id\n"
while {1} {
expect {
eof break
-i $rz_spawn_id -re .+ {
send -raw -i $ssh_spawn_id $expect_out(buffer)
}
-i $ssh_spawn_id -re .+ {
send -raw -i $rz_spawn_id $expect_out(buffer)
}
}
}
send_user "\nFinished zmodem receive.\n"
set spawn_id $ssh_spawn_id
}
This run rzafter viewing the frame ZRQINIT, and it apparently connects
rzto the ssh session, but it does not work. rzHe speaks:
Retry 0: Bad CRCe.**B0100000023be50
Retry 0: Bad CRC**B0600000023d984
Retry 0: Bad CRC**B0600000023d984
... etc.
Is there any way to make this work? Thank!
source
share