[ale] Perl 'Expect' timeout question

Mills John M-NPHW64 Jmills at motorola.com
Mon Oct 4 11:01:41 EDT 2010


Chris -

Thanks for both replies.

Yes, the 'expect' example works fine.

I would like to salvage my existing scripts if possible - can I check whether the reverse look-up is what actually failed?

 - Mills

-----Original Message-----
From: ale-bounces at ale.org on behalf of Chris Fowler
Sent: Mon 10/4/2010 10:20 AM
To: Atlanta Linux Enthusiasts - Yes! We run Linux!
Subject: Re: [ale] Perl 'Expect' timeout question
 
Use just Expect.

use Expect;
use strict;

my $exp = Expect->spawn('ssh user at host');
$exp->expect(10, 'password:');
$exp->send("password\r");
$exp->expect(5, "]$ ") or die "password authentication failed";
$exp->send("command\r");
....

$exp->close();

On Mon, 2010-10-04 at 10:12 -0400, Mills John M-NPHW64 wrote:
> ALErs -
> 
> I wrote a Perl script that uses net-SSH::Expect to connect with a
> remote target by SSH. I can establish the connection manually without
> any problem, but my scripts (which had been working) now fail with the
> message:
>  "SSHAuthenticationError Login timed out" coming from ".../Expect.pm
> line 813". This line is in the function '_multi_expect($$@)' and the
> timeout is presumably passed when the function is called.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3213 bytes
Desc: not available
Url : http://mail.ale.org/pipermail/ale/attachments/20101004/a7e85796/attachment-0001.bin 


More information about the Ale mailing list