I need some help tweaking my code to look for another attribute in this unix df
output:
Ex.
Filesystem Size Used Avail Capacity
I think it is probably best to split the lines, skipping the first line. Since you don't mind using @df
and $df
, neither do I:
my @df = qx(df -k /tmp);
shift @df; # Lose df heading line
foreach my $df (@df)
{
my($system, $size, $used, $avail, $capacity, $mount) = split / +/, $df;
....
}
This gives you all the fields at once. Now you just need to interpret the 'G' and lose the '%', etc.