Tried your suggestion, but no luck. Check out below ...
root@F101-8:~/sgopala1# root@F101-8:~/sgopala1# cat test.pl #!/usr/bin/perl5.8.4 use Expect; my $timeout = 5; $session = new Expect; $session->exp_internal(1); #$session->debug(3); $session->spawn("ssh 10.20.30.40 -l root"); $session->expect($timeout, "pirates:"); $session->send("motorola\n"); $session->expect($timeout, "F101"); $session->send("\n"); $session->expect($timeout, "F101"); $session->send("exit\n"); $session->expect($timeout, "F101"); root@F101-8:~/sgopala1# root@F101-8:~/sgopala1# root@F101-8:~/sgopala1# root@F101-8:~/sgopala1# perl test.pl Spawned 'ssh 10.20.30.40 -l root' spawn id(3) Pid: 31038 Tty: /dev/pts/2 Expect::spawn('Expect=GLOB(0x1028abc8)', 'ssh 10.20.30.40 -l r +oot') called at test.pl line 9 Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x1028abc8)', 5, 'pirates:') calle +d at test.pl line 10 spawn id(3): list of patterns: #1: -ex `pirates:' spawn id(3): Does `' match: pattern #1: -ex `pirates:'? No. Sending 'motorola\n' to spawn id(3) Expect::print('Expect=GLOB(0x1028abc8)', 'motorola\x{a}') call +ed at test.pl line 11 Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x1028abc8)', 5, 'F101') called at + test.pl line 12 spawn id(3): list of patterns: #1: -ex `F101' spawn id(3): Does `' match: pattern #1: -ex `F101'? No. Sending '\n' to spawn id(3) Expect::print('Expect=GLOB(0x1028abc8)', '\x{a}') called at te +st.pl line 13 Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x1028abc8)', 5, 'F101') called at + test.pl line 14 spawn id(3): list of patterns: #1: -ex `F101' spawn id(3): Does `' match: pattern #1: -ex `F101'? No. Sending 'exit\n' to spawn id(3) Expect::print('Expect=GLOB(0x1028abc8)', 'exit\x{a}') called a +t test.pl line 15 Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x1028abc8)', 5, 'F101') called at + test.pl line 16 spawn id(3): list of patterns: #1: -ex `F101' spawn id(3): Does `' match: pattern #1: -ex `F101'? No. root@F101-8:~/sgopala1# root@F101-8:~/sgopala1# root@F101-8:~/sgopala1#

In reply to Re^7: Expect package not working on a Power PC machine by sri75
in thread Expect package not working on a Power PC machine by sri75

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.