/[cricket]/parse_df.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /parse_df.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by dpavlin, Mon Jul 15 10:26:21 2002 UTC revision 1.3 by dpavlin, Mon Jul 15 10:27:41 2002 UTC
# Line 29  sub parse_df { Line 29  sub parse_df {
29                  chomp;                  chomp;
30                  my ($node,$total,$used,$aval,$use_pcnt,$mount) = split(/\s+/,$_,6);                  my ($node,$total,$used,$aval,$use_pcnt,$mount) = split(/\s+/,$_,6);
31                  if ($use_pcnt && $use_pcnt =~ s/(\d+)%/$1/) {                  if ($use_pcnt && $use_pcnt =~ s/(\d+)%/$1/) {
32                          print STDERR "$_\n";  #                       print STDERR "$_\n";
33  #                       $df{$mount}=$use_pcnt;  #                       $df{$mount}=$use_pcnt;
34                          $df{$mount}=$used * 100 / $total if ($total != 0);                          $df{$mount}=$used * 100 / $total if ($total != 0);
35  #                       print $df{$mount}," == $use_pcnt\n";  #                       print $df{$mount}," == $use_pcnt\n";
# Line 53  EOF Line 53  EOF
53                          $target = "root";                          $target = "root";
54                  } else {                  } else {
55                          $target =~ s,^/,,;                          $target =~ s,^/,,;
56                            $target =~ s,/,_,g;
57                  }                  }
58                  print <<"EOF";                  print <<"EOF";
59  target  $target  target  $target

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.26