http://qs1969.pair.com?node_id=67588


in reply to Regular Expression Question

Do you mean box, or filesystem? I'll do both. (I'm good like that.)
$/ = ""; while (<>) { my ($box) = /(.*)/; my ($t_used, $t_avail); for (split /\n/) { my ($fd,$used,$avail,$per) = /^(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\%/ or next; $t_used += $used; $t_avail += $avail; warn "$box:$fd at $per%\n" if $per > 88; } my $t_per = int(100 * $t_used / $t_avail); warn "$box at $t_per%\n" if $t_per > 88; }


japhy -- Perl and Regex Hacker