Anybody know why I am timing out 
Author Message
 Anybody know why I am timing out

I have the following Expect script spawning an ftp proces and it logs
me in, but it stops running after logging me in ?

#!/usr/bin/expect -f
spawn ftp -i ftp.someftpsite
set timeout 180
expect "Name:"
send "myuserid\r"
expect "Password:"
sleep 2
send "mypassword\r"
sleep 1
send "bin\r"
expect "ftp>"
send "cd Outbound\r"
sleep 5
expect "ftp>"
send "mget *\r"



Mon, 24 Jul 2006 03:07:27 GMT  
 Anybody know why I am timing out

Quote:

>I have the following Expect script spawning an ftp proces and it logs
>me in, but it stops running after logging me in ?

>#!/usr/bin/expect -f
>spawn ftp -i ftp.someftpsite
>set timeout 180
>expect "Name:"
>send "myuserid\r"
>expect "Password:"
>sleep 2
>send "mypassword\r"
>sleep 1
>send "bin\r"
>expect "ftp>"
>send "cd Outbound\r"
>sleep 5
>expect "ftp>"
>send "mget *\r"

1.  It would surprise me to learn that the [sleep]s help
    materially.  They might not hurt, though.
2.  I'm a big fan of tcllib's ftp package as a substitute
    for this sort of Expect-ing.
3.  I'd use the standard Expect debugging techniques on
    this problem.  You *do* know how to use autoexpect,
    -d, and so on, right?
4.  Are you *sure* it "stops running"?  What output that
    you expect to see does it fail to produce?
--


Business:  http://www.Phaseit.net



Mon, 24 Jul 2006 03:47:23 GMT  
 Anybody know why I am timing out
Quote:



> >I have the following Expect script spawning an ftp proces and it logs
> >me in, but it stops running after logging me in ?

> >#!/usr/bin/expect -f
> >spawn ftp -i ftp.someftpsite
> >set timeout 180
> >expect "Name:"
> >send "myuserid\r"
> >expect "Password:"
> >sleep 2
> >send "mypassword\r"
> >sleep 1
> >send "bin\r"
> >expect "ftp>"
> >send "cd Outbound\r"
> >sleep 5
> >expect "ftp>"
> >send "mget *\r"

> 1.  It would surprise me to learn that the [sleep]s help
>     materially.  They might not hurt, though.
> 2.  I'm a big fan of tcllib's ftp package as a substitute
>     for this sort of Expect-ing.
> 3.  I'd use the standard Expect debugging techniques on
>     this problem.  You *do* know how to use autoexpect,
>     -d, and so on, right?

      No, I don't know how to do this
Quote:
> 4.  Are you *sure* it "stops running"?  What output that
>     you expect to see does it fail to produce?

      Right after it logs me into the ftp server, I see some
      messages from the ftp server that verifies I am on, but then
      it puts me back to my command prompt on my system, it is almost
      like it is having a problem starting at the 'send "bin\r"' command ?


Tue, 25 Jul 2006 00:14:57 GMT  
 Anybody know why I am timing out

                        .
                        .
                        .
Quote:
>> 3.  I'd use the standard Expect debugging techniques on
>>     this problem.  You *do* know how to use autoexpect,
>>     -d, and so on, right?
>      No, I don't know how to do this

                        .
                        .
                        .
Ah!  Does <URL: http://wiki.tcl.tk/DebuggingExpect > give
enough of a start, or would you like more detail on how to
go about it?
--


Business:  http://www.Phaseit.net



Tue, 25 Jul 2006 01:01:21 GMT  
 Anybody know why I am timing out

Quote:





>> >I have the following Expect script spawning an ftp proces and it logs
>> >me in, but it stops running after logging me in ?

>> >#!/usr/bin/expect -f
>> >spawn ftp -i ftp.someftpsite
>> >set timeout 180
>> >expect "Name:"
>> >send "myuserid\r"
>> >expect "Password:"
>> >sleep 2
>> >send "mypassword\r"
>> >sleep 1
>> >send "bin\r"
>> >expect "ftp>"
>> >send "cd Outbound\r"
>> >sleep 5
>> >expect "ftp>"
>> >send "mget *\r"

                        .
                        .
                        .

Quote:
>> 4.  Are you *sure* it "stops running"?  What output that
>>     you expect to see does it fail to produce?
>      Right after it logs me into the ftp server, I see some
>      messages from the ftp server that verifies I am on, but then
>      it puts me back to my command prompt on my system, it is almost
>      like it is having a problem starting at the 'send "bin\r"' command ?

Hmmmmmm.  One change I'd make is to write
  expect "ftp> "
rather than
  expect "ftp>"
That has the potential to produce the symptom you describe.
--


Business:  http://www.Phaseit.net



Tue, 25 Jul 2006 01:04:42 GMT  
 Anybody know why I am timing out

Quote:



> >I have the following Expect script spawning an ftp proces and it logs
> >me in, but it stops running after logging me in ?

> >#!/usr/bin/expect -f
> >spawn ftp -i ftp.someftpsite
> >set timeout 180
> >expect "Name:"
> >send "myuserid\r"
> >expect "Password:"
> >sleep 2
> >send "mypassword\r"
> >sleep 1
> >send "bin\r"
> >expect "ftp>"
> >send "cd Outbound\r"
> >sleep 5
> >expect "ftp>"
> >send "mget *\r"

> 1.  It would surprise me to learn that the [sleep]s help
>     materially.  They might not hurt, though.
> 2.  I'm a big fan of tcllib's ftp package as a substitute
>     for this sort of Expect-ing.
> 3.  I'd use the standard Expect debugging techniques on
>     this problem.  You *do* know how to use autoexpect,
>     -d, and so on, right?
> 4.  Are you *sure* it "stops running"?  What output that
>     you expect to see does it fail to produce?

I used Autoexpect and this fixed the problem.


Tue, 25 Jul 2006 04:43:36 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Why am I getting intermittant time outs with my test set?

2. Sockets and time-outs

3. Avoiding long time-outs when reusing sockets in SocketServer

4. Anybody know of good compression / zip library

5. PL/PC - Anybody know about the current status

6. Does anybody know 'Enfin'?

7. Does anybody know about PrinterDialog?

8. AppMan Pro 2 Anybody know about it

9. Anybody Know RealWorld Date format?

10. Anybody know how to fix this error?

11. Does anybody knows who made SilverClip library..

12. Does anybody know.......

 

 
Powered by phpBB® Forum Software