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
20.9.2014 - We have just updated our course layouts and descriptions and added our 2015 schedule.

Expect hangs!!!

Posted by naveenpn (naveenpn), 11 January 2009
  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

...Out of Expect #

  But once this hangs it looks like


    Screen shot for this

^Mswitch(config-if-hsrp)# echo 704802.0^M
^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], 1 ucast next-hops, 0 mcast next-hops
  *via Null0, [220/0], 00:25:03, local, discard, 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 ?


This page is a thread posted to the opentalk forum at 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., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: • WEB: • SKYPE: wellho