Using expect with telnet menu



I am trying to write a script to telnet from a power broker jumpbox to
a host. The hosts are listed in a numbered menu that changes
periodically. The list below is similar to my actual list. If i want
to log into host pear.domain.com, I would select "3". If the list is
modified, pear may become option 4 or 2. How can I have expect match
pear.domain.com and return it's current menu option?

==============================================================================
Power Broker Access
==============================================================================
1 apple.domain.com 3 pear.domain.com 5
cherry.domain.com
2 orange.domain.com 4 banana.domain.com 6 lime.domain.com
==============================================================================
Please choose a system:

.



Relevant Pages

  • Expect, telnet, frozen console.
    ... telnet into remote host, provide username/password, surrender control to ... This script will eventually be tied into /etc/inittab so that it ... app called 'loe' which presents a login screen in 80x24 ASCII a la ...
    (comp.lang.tcl)
  • Re: rlogin
    ... login the server using telnet, rsh, rlogin and also ssh. ... Telnet does not provide any protection. ... We have only 1 host system. ...
    (comp.unix.aix)
  • Re: unable to send outbound mail using outlook
    ... telnet moses.stphilipchurch.com 25 ... Connecting To moses.stphilipchurch.com...Could not open connection to the ... on port 25: Connect failed ... Connecting To 66.126.247.115...Could not open connection to the host, ...
    (microsoft.public.exchange.admin)
  • Re: No route to host
    ... route to host" is returned. ... three telnet tests to try and the results are below. ... Connection closed by foreign host. ...
    (comp.mail.sendmail)
  • Re: How do you telnet from 1 host to another using Telnet Module
    ... help you more in understanding, from my limited experience with using this module I have managed to successfully telnet from the host that my script executes on to a remote host, I can do this ok using the ...
    (comp.lang.perl.modules)