Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
freezing output

Posted by erickio (erickio), 27 December 2004
I have a tcl/expect script that sends a "show ip route" command to a router. The output that is displayed from this command is around 800 to 100 lines. I don't understand what the source of the problem would be, but about half the time while the screen is displaying the output, my script freezes, and doesn't start again. I don't know if this is an issue with the size of the buffer being too small, or what else it could be. if you need any code examples i can show. tia

Posted by admin (Graham Ellis), 27 December 2004
Potentially a timing problem or something - use log_user to trace the output and see where it hangs.

Yes - a code sameple would help - otherwise we're guessing   - see the "posting FAQ" at http://www.wellho.net/forum/Assistance/Posting-FAQ.html

Posted by erickio (erickio), 27 December 2004
instead of using log_user to trace the output i used it to mask the output. and it seems to work fine now (im getting a diff problem now), but in terms of hanging while displaying the information, my script works. i think the reason it was hanging is that too much information was being displayed and it was making my script crash.


------
#sid is the spawn_id
#shop is the show command output

global sid shop
set shop ""

send -i $sid "show ip route\n"

expect {
  -i $sid "*\n" {append shop $expect_out(buffer)
                exp_continue
               }
  -i $sid "#" {}
   }

send -i $sid "exit\n"



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho