On Thu, Nov 24, 2011 at 12:09 PM, Charith LokuBogahawatta
<charith...@gmail.com> wrote:
> Hi All,
>
> I create following bash script to run some command on remote server
> and get information but I try to do same using Perl but I couldn't
> make it so any one can suggest way to get done this using perl ?
>
> my .sh...................................
>
> ssh -T $LOGIN <<EOI
> cd /x02/oracle/downloads
> find ./ -type d | sed -e 's/[^-][^\/]*\//--/g;s/--/ |-/'
>>DirectoryStructure.txt
> cat DirectoryStructure.txt
> exit
> EOI
>
> Here I'm getting directory structure of inside download folder also
> appreciate if can give idea to create this same directory structure on
> another remote machine using perl.Thanks for your help
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

you could use the Net::SSH::Perl module

my $ssh = Net::SSH::Perl->new($serverhost);
    $ssh->login($user,$passwd);
    my($output, $stderr, $exit) =  $ssh->cmd(" ls -la ");



-- 
Regards
Agnello D'souza

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