ftp script in expect
Chris Janicki
Janicki at ia-inc.com
Wed Sep 19 17:07:35 EDT 2001
Maybe you have to "expect" each line of feedback as the files are
downloaded... in some sort of loop, waiting for the "ftp>" to return?
IMHO, Expect sucks... I was forced to write an app with it once, and the
stupid thing would fail after hours/days of perfect operation. It an
unreliable hack in my experience. Plus, that "monkey on the cover"
O'reilly book is a disorganized jumble. I'd rather program my own FTP
client from scratch rather than use Expect again. (Do I sound bitter?
;-)
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 9/19/01, 6:31:53 PM, Scott Lanning <slanning at buphy.bu.edu> wrote
regarding Re: ftp script in expect:
> On Wed, 19 Sep 2001, Ron Peterson wrote:
> >What with the constant barrage of new and improved virii, I thought I'd
> >make it easier to help my Windows friends. So I wrote this little
expect
> >script. Problem is, it stops downloading and quits after one file.
> >
> >(?)
> >
> >spawn ftp ftp.nai.com
> >expect "Name*:"
> >send "anonymous\r"
> >expect "Password:"
> >send "devnull at pagoda.mtholyoke.edu\r"
> >expect "ftp>"
> >send "cd pub/antivirus/datfiles/4.x\r"
> >expect "ftp>"
> >send "bin\r"
> >expect "ftp>"
> >send "prompt\r"
> >expect "ftp>"
> >send "mget *\r"
> >expect "ftp>"
> >send "quit"
> Whenever I do mget, it prompts for each file, like:
> ftp> mget *.txt
> mget foo.txt?
> and then you have to hit Enter each time.
> -
> Subcription/unsubscription/info requests: send e-mail with
> "subscribe", "unsubscribe", or "info" on the first line of the
> message body to discuss-request at blu.org (Subject line is ignored).
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).
More information about the Discuss
mailing list