Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageI'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
Post Follow-up to this messagePuneet 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
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.