Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2002 01:18:11 -0400
From:      Paul Chvostek <paul+isp@it.ca>
To:        questions@freebsd.org
Subject:   Expect and zmodem
Message-ID:  <20020627011811.A31599@mail.it.ca>

next in thread | raw e-mail | index | archive | help

I'm trying to write an expect script that will log on to a proprietary
online service, follow some menus, and upload a file using zmodem.  The
zmodem package I'm trying to use is lrzsz, in a script that looks like:

#!/usr/local/bin/expect -f
spawn cu -l /dev/cuaa0 -s 57600 dir
expect Connected
send atdt9,9995551234
expect CONNECT
send ...
expect ...
...
expect "> "
send "upload\r"
expect "rz ready"
exec /usr/local/bin/lsz /path/to/file && mv /path/to/file /path/to/done/
expect "> "
send "bye\r"
expect eof

(Okay, there's alot more glue than that, but you get the idea.)  It all
works fine up to the point that I want to run lsz.  The problem is that
lsz wants to talk zmodem through stdio rather than on an arbitrary port
(/dev/cuaa0 in this case), and expect is just execing it rather than
spawning and joining it to my existing "cu" session.  The lsz manpage
says I can set ONAME to the device I want to use, but doing so doesn't
appear to change lsz's behaviour inside expect (or I'm still missing
something, which is more likely).

How do people deal with this sort of thing?  Is there a solution that
lets me stick with lsz rather than moving to (commercially licensed)
zmtx with its -l option?

Thanks.  :)

-- 
  Paul Chvostek                                             <paul@it.ca>
  Operations / Abuse / Whatever                          +1 416 598-0000
  it.canada - hosting and development                  http://www.it.ca/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020627011811.A31599>