On Jan 3, 1:56 pm, perl.ha...@gmail.com (Perl_haxor 123) wrote:
> Hi All,
>
>            I'm new to perl and facing a problem........ I'm using a perl
> expect script to login to multiple machines (having same username and
> password) and execute the date command, initially i tested on one machine,
> it worked fine...........but when i use a foreach loop to test the same
> thing on two machines (the code is shown below), it didn't work.......it
> just worked on the first machine (10.10.10.1) ........can someone please
> help me out with this problem?......how can i use the perl expect script to
> login to the multiple machines (assuming they have same username and
> password) and execute commands?.. Kindly help me with this problem
>
> #############################################################
> #!/usr/bin/perl -w
> use strict;
> use Expect;
>
> foreach ("10.10.10.1", "10.10.10.2") {
> print "Spawning to the $_\n";
> $exp->spawn("ssh -l username $_") or warn "unable to spawn: $!";
>

No idea really but you might want to invoke ssh with debug settings
for possible additional clues:

spawn("ssh -v -l username .... ") ...          # man ssh

--
Charles DeRykus


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to