Hello !!! I forgot to attach the result from the suggestion using the $session->exp_internal(1);
root@F101-8:~# 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 666.666.666.666 -l root\r"); $session->expect($timeout, "password:"); $session->send("wibbilwobble\r"); $session->expect($timeout, "F101"); $session->send("\r"); $session->expect($timeout, "F101"); $session->send("exit\r"); $session->expect($timeout, "F101"); root@F101-8:~# root@F101-8:~# root@F101-8:~# perl test.pl 'pawned 'ssh 666.666.666.666 -l root spawn id(3) Pid: 20277 Tty: /dev/pts/2 Expect::spawn('Expect=GLOB(0x1028abbc)', 'ssh 666.666.666.666 +-l root\x{d}') called at test.pl line 9 Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x1028abbc)', 5, 'password:') call +ed at test.pl line 10 spawn id(3): list of patterns: #1: -ex `password:' spawn id(3): Does `' match: pattern #1: -ex `password:'? No. Sending 'wibblewobble\r' to spawn id(3) Expect::print('Expect=GLOB(0x1028abbc)', 'wibblewobble\x{d}') +called at test.pl line 11 Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x1028abbc)', 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 '\r' to spawn id(3) Expect::print('Expect=GLOB(0x1028abbc)', '\x{d}') called at te +st.pl line 13 Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x1028abbc)', 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\r' to spawn id(3) Expect::print('Expect=GLOB(0x1028abbc)', 'exit\x{d}') called a +t test.pl line 15 Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x1028abbc)', 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:~#
Thanks Sri

IP address and password changed to protect the inocent (GrandFather)


In reply to Re^3: 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.