[TriLUG] Perl question

Allen Freeman knieveltech at yahoo.com
Fri Mar 13 19:52:29 EDT 2009


What happens if you just go

$ssh = Expect->spawn("ssh -l $username $ip")

If this call failing shouldn't stall your script why check to see if it's successful in the first place?

Sorry I can't be of more immediate help, I quit coding perl two years ago.


--- On Sat, 3/14/09, Greg Brown <gwbrown1 at gmail.com> wrote:
From: Greg Brown <gwbrown1 at gmail.com>
Subject: [TriLUG] Perl question
To: "Triangle Linux Users Group General Discussion" <trilug at trilug.org>
Date: Saturday, March 14, 2009, 4:08 AM

Can anyone help me out what this will work:

$ssh = Expect->spawn("ssh -l $username $ip") || die
"didn't work: $!\n";

but this will NOT work:

$ssh = Expect->spawn("ssh -l $username $ip") || next;

nor will this

next if (not $ssh = Expect->spawn("ssh -l $username $ip"));

I'd really REALLY like to have the failures skip to the next one.. I've
got
over 1000 routers to update tonight via this script and it's killing me
stopping ever 5 or so because TACACS isn't properly configured (or whatever
the malady is).

Any help would be greatly appreciated!!

Greg
--
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions



      


More information about the TriLUG mailing list