For Programmers: Free Programming Magazines  


Home > Archive > Tcl > April 2005 > Expect hang to get buigger output...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Expect hang to get buigger output...
Puneet

2005-04-26, 4:02 am

Hi All,

I dont know why expect hangs..... when it tries to get a bigger output
from ssh, In telnet it is not hang. So i think one of conclusion is may
be some timing issue or packets size issue. But i have gbic lan card,
so packet issue can not be come. May be some timing issue or buffer
issuse in picture.

Can anybody tell me the exact problem of hanging and solution.

I have another question is that how to clear expect_out(buffer) memory.

Thanks in advance,
-- Puneet

Patrick Dunnigan

2005-04-26, 4:02 pm

I'd suggest setting exp_internal to one and seeing what the pattern matching
is. Post here if it's not clear to you. Does the beginning of the pattern
you are looking for span over 2000 bytes to the end of the pattern? Then you
might need to set your match_max variable to some higher number of bytes.

Outside of the login, there should not be any difference in the way output
is displayed from ssh to telnet (give the same shell / terminal on the other
end).

I think you clear the expect_out(buffer) but just performing the expect
command without any parameters:

expect


"Puneet" <mr.puneet.goyal@gmail.com> wrote in message
news:1114492365.062732.171090@z14g2000cwz.googlegroups.com...
Hi All,

I dont know why expect hangs..... when it tries to get a bigger output
from ssh, In telnet it is not hang. So i think one of conclusion is may
be some timing issue or packets size issue. But i have gbic lan card,
so packet issue can not be come. May be some timing issue or buffer
issuse in picture.

Can anybody tell me the exact problem of hanging and solution.

I have another question is that how to clear expect_out(buffer) memory.

Thanks in advance,
-- Puneet


Khaled

2005-04-27, 3:59 am

Puneet wrote:
> Hi All,
>
> I dont know why expect hangs..... when it tries to get a bigger

output
> from ssh, In telnet it is not hang. So i think one of conclusion is

may
> be some timing issue or packets size issue. But i have gbic lan card,
> so packet issue can not be come. May be some timing issue or buffer
> issuse in picture.
>
> Can anybody tell me the exact problem of hanging and solution.
>
> I have another question is that how to clear expect_out(buffer)

memory.
>
> Thanks in advance,
> -- Puneet



My best practice to avoid getting into such problem is to adapt my code
to match every line as it comes using regexp and anchors. If you can
quote your code I might be able to see how it can be improved. You can
also try to turn on debugging [exp_internal 1] and see what exactly is
happenning. Perhaps there are some extra characters generated only
during yr ssh session that affects your matching.

Rgrds,
Khaled

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com