Thread df auslesen, regexp problem (24 answers)
Opened by FlorianL at 2007-05-25 14:41

bloonix
 2007-05-25 18:55
#76936 #76936
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
aber die regex oder split passt nicht mehr, wenn der diskname so lang ist,
dass die diskgroessen in die nächste zeile geschrieben werden etc.

Code: (dl )
1
2
3
4
5
6
7
8
use strict;
use warnings;
use Sys::Statistics::Linux;
my $lxs  = Sys::Statistics::Linux->new(DiskUsage => 1);
my $stat = $lxs->get->{DiskUsage};

print sprintf('%-40s ', $_), $stat->{$_}->{usageper}, "%\n"
  foreach sort keys %$stat;
\n\n

<!--EDIT|opi|1180115142-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread df auslesen, regexp problem