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))
Expect hangs!!!

Posted by naveenpn (naveenpn), 11 January 2009
Hi,
  I have script which is based on TCL and expect. It is written to test my code. It usually runs fine for a while and hangs after sometime.


  Code snippet

       set l_temp_timeout $timeout
       OUTPUT_LOG2 2 >>>$expect_out(buffer)<<<
       OUTPUT_LOG2 2 "Expecting...$my_prompt"
       set timeout 3
       
       expect  {
           $my_prompt { set l 1 }
           timeout  { OUTPUT_LOG2 2 $expect_out(buffer) }
       }
       OUTPUT_LOG2 2 "...Out of Expect $my_prompt"



  My log  for this code normally  looks like

Retrying...
>>>^M^M
238114.0^M
^Mswitch(config-if-hsrp)#<<<
Expecting...#
...Out of Expect #



  But once this hangs it looks like


Retrying...
>>>^M^M
704802.0^M
^Mswitch(config-if-hsrp)#<<<
Expecting...#

   
    Screen shot for this

^Mswitch(config-if-hsrp)# echo 704802.0^M
704802.0
^Mswitch(config-if-hsrp)# sh ip route vrf all^M
sh ip route vrf all

IP Route Table for VRF "default"
:
:
:
:
IP Route Table for VRF "cisco3"
'*' denotes best ucast next-hop       '**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]

0.0.0.0/32, 1 ucast next-hops, 0 mcast next-hops
  *via Null0, [220/0], 00:25:03, local, discard
255.255.255.255/32, 1 ucast next-hops, 0 mcast next-hops
  *via sup-eth1, [0/0], 00:25:03, local



 Even I noticed that the prompt did not come back. Not sure whats the problem. Even if the prompt which is "#" did not show up, at least it should have timed out.

 Why is it hanging ?


 Thanks
Naveen





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