diff --git a/mount/freebsd-lib.pl b/mount/freebsd-lib.pl index 73d0348e4..9387df220 100755 --- a/mount/freebsd-lib.pl +++ b/mount/freebsd-lib.pl @@ -323,8 +323,8 @@ if (&get_mounted($_[1], "*") < 0) { return (); } if ($_[0] eq "proc" || $_[0] eq "swap") { return (); } my $out; &execute_command("df -k ".quotemeta($_[1]), undef, \$out, undef, 0, 1); -if ($out =~ /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) { - return ($1, $2); +if ($out =~ /Mounted on\n\S+\s+(?\S+)\s+(?\S+)\s+(?\S+)\s+(?\d+)/) { + return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}"); } else { return ( ); diff --git a/mount/macos-lib.pl b/mount/macos-lib.pl index e50e10244..506773230 100755 --- a/mount/macos-lib.pl +++ b/mount/macos-lib.pl @@ -107,9 +107,9 @@ sub disk_space { if (&get_mounted($_[1], "*") < 0) { return (); } if ($_[0] eq "proc" || $_[0] eq "swap") { return (); } -if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~ - /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) { - return ($1, $2); +my $out = &backquote_command("df -k ".quotemeta($_[1]), 1); +if ($out =~ /Mounted on\n\S+\s+(?\S+)\s+(?\S+)\s+(?\S+)\s+(?\d+)/) { + return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}"); } return ( ); } diff --git a/mount/netbsd-lib.pl b/mount/netbsd-lib.pl index 7989428ff..592230298 100755 --- a/mount/netbsd-lib.pl +++ b/mount/netbsd-lib.pl @@ -231,9 +231,9 @@ sub disk_space { if (&get_mounted($_[1], "*") < 0) { return (); } if ($_[0] eq "proc" || $_[0] eq "swap") { return (); } -if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~ - /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) { - return ($1, $2); +my $out = &backquote_command("df -k ".quotemeta($_[1]), 1); +if ($out =~ /Mounted on\n\S+\s+(?\S+)\s+(?\S+)\s+(?\S+)\s+(?\d+)/) { + return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}"); } return ( ); } diff --git a/mount/openbsd-lib.pl b/mount/openbsd-lib.pl index df963d091..9748b9ac0 100755 --- a/mount/openbsd-lib.pl +++ b/mount/openbsd-lib.pl @@ -232,9 +232,9 @@ sub disk_space { if (&get_mounted($_[1], "*") < 0) { return (); } if ($_[0] eq "proc" || $_[0] eq "swap") { return (); } -if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~ - /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) { - return ($1, $2); +my $out = &backquote_command("df -k ".quotemeta($_[1]), 1); +if ($out =~ /Mounted on\n\S+\s+(?\S+)\s+(?\S+)\s+(?\S+)\s+(?\d+)/) { + return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}"); } return ( ); } diff --git a/mount/osf1-lib.pl b/mount/osf1-lib.pl index 3b17aa25f..134aa3880 100755 --- a/mount/osf1-lib.pl +++ b/mount/osf1-lib.pl @@ -262,9 +262,9 @@ if (&get_mounted($_[1], "*") < 0) { return (); } if ($_[0] eq "fd" || $_[0] eq "proc" || $_[0] eq "swap" || $_[0] eq "autofs") { return (); } -if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~ - /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) { - return ($1, $2); +my $out = &backquote_command("df -k ".quotemeta($_[1]), 1); +if ($out =~ /Mounted on\n\S+\s+(?\S+)\s+(?\S+)\s+(?\S+)\s+(?\d+)/) { + return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}"); } return ( ); }