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 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
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., 2022: 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