Hi list,

I want to do a 'df' on a diretory on another machine via 'rexec'. I
thought I could do that via the Perl module Filesys::Df, but then I
realized that I can't call a function of a module directly because the
rexec executes a normal shell command. I would have wanted something
like this:

use strict;
use warnings;
use Filesys::Df;
use Net::Rexec 'rexec';

my $df=df("/backup");
my ($rc, @output) = rexec ("myhost", $df);    # OUCH!
print "RC: $rc\n";
print "Output: @output\n";

Since this is nonsense that doesn't work, could you please point me in
the right direction how to approach this best? So far, I found two
possible solutions both of which seem very un-Perl to me: Either by
rexec("myhost", 'df -m /backup|tail -1 |awk \'{print $3}\''); or by
executing a separate Perl script which uses the Filesys::Df module.

Any suggestions?

Thanks, 
Nora 



Reply via email to