Can someone take of the SPAM Assin???

---------- Forwarded message ----------
From: marcos rebelo <ole...@gmail.com>
Date: Wed, Oct 20, 2010 at 12:34 PM
Subject: Re: SSH to remote machines..
To: Bob Null <burnabybo...@gmail.com>
Cc: beginners@perl.org


I usually use

http://search.cpan.org/dist/Net-SSH-Perl/lib/Net/SSH/Perl.pm

sample

use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);
my @instructions = ("ping this","run this","open this","rm
this","mkdir some/dir")
foreach $cmd (@instructions){
   my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
   ...
}

Best Regards
Marcos Rebelo

On Tue, Oct 19, 2010 at 11:43 AM, Bob Null <burnabybo...@gmail.com> wrote:
> Hello Folks,
>
> I want to create a chuck of code that will take a list of instructions
> (things one would type at a shell) and have them run one by one until
> complete, then gracefully log out. Anyone have any suggestions? I
> would like something that looks similar to this:
>
> my @instructions = ("ping this","run this","open this","rm
> this","mkdir some/dir")
> $ssh = Net::Some::AwsomePM->new();
> foreach $cmd (@instructions){
>        $ssh->cmd($cmd);
>        wait_for_cmd_to_finish;
> }
> $ssh->cmd('exit');
>
> If anyone can post a sample of what this would look like that would be
> the most helpful as I am still getting my bearings here.
>
> Cheers,
>
> Bob H
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>



--
Marcos Rebelo
http://oleber.freehostia.com
Milan Perl Mongers leader http://milan.pm.org
Webmaster of http://perl5notebook.oleber.com



-- 
Marcos Rebelo
http://oleber.freehostia.com
Milan Perl Mongers leader http://milan.pm.org
Webmaster of http://perl5notebook.oleber.com

--
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