Home: Perl Programming Help: Intermediate:
problem with df command



digioleg54
User

Mar 22, 2017, 2:03 PM


Views: 5851
problem with df command

I am trying to use
use Filesys::Df;

my $dsk_spc = df(.);

print "disk $dsk_spc{per}"

But the message says
Can't locate Filesys/Df.pm in @INC (@INC contains: /applications/ua3/perl-lib /applications/ua3/perl /export/applications/ibm6000/CPAN/64-5.8.8-vac8-aix5.3/lib/perl5/5.8.8/aix-thread-multi-64all /export/applications/ibm6000/CPAN/64-5.8.8-vac8-aix5.3/lib/perl5/5.8.8 /export/applications/ibm6000/CPAN/64-5.8.8-vac8-aix5.3/lib/perl5/site_perl/5.8.8/aix-thread-multi-64all /export/applications/ibm6000/CPAN/64-5.8.8-vac8-aix5.3/lib/perl5/site_perl/5.8.8 /export/applications/ibm6000/CPAN/64-5.8.8-vac8-aix5.3/lib/perl5/site_perl

What can I use instead?


Laurent_R
Veteran / Moderator

Mar 23, 2017, 3:17 AM


Views: 5840
Re: [digioleg54] problem with df command

This means that the Filesys::Df module is not installed on your system. Why don't you simply install it?

There are other modules doing similar things, such as Filesys::DiskFree, but it's probably not installed either, so you would have to install it too.

If you can't install these modules, and assuming you're on Linux or Unix, you could possibly run the system df within backticks and retrieve the output.


digioleg54
User

Mar 24, 2017, 9:13 AM


Views: 5823
Re: [Laurent_R] problem with df command

Laurent,
It is not my company. It is a huge bank and install something on prod. requires big meeting and preparation job. My question is, how can I do it without this package. Or may be there is another command? I cannot use UNIX command, server doesn't have it


FishMonger
Veteran / Moderator

Mar 24, 2017, 1:00 PM


Views: 5818
Re: [digioleg54] problem with df command

I need to double check, but I believe both of those modules are pure perl (just like your script), so if you can install your script on the server, you can install the modules in the same manner.

What OS is the server?


digioleg54
User

Mar 27, 2017, 8:11 AM


Views: 5786
Re: [FishMonger] problem with df command

It is appach. I cannot do it myself on QA or prod. Not in this company. How can I use shell command in Perl script?


Laurent_R
Veteran / Moderator

Mar 27, 2017, 9:54 AM


Views: 5782
Re: [digioleg54] problem with df command

Apache is not an OS. We really need to know the OS (Linux, Unix, Windows, VMS, Mac, etc.) to have a chance to help you.


digioleg54
User

Mar 27, 2017, 10:22 AM


Views: 5780
Re: [Laurent_R] problem with df command

UNIX


Laurent_R
Veteran / Moderator

Mar 28, 2017, 1:27 PM


Views: 5766
Re: [digioleg54] problem with df command

Then you should be able to run the df system command within backticks.