Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Regular Expression Question

by japhy (Canon)
on Mar 27, 2001 at 23:11 UTC ( [id://67588]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://67588]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-19 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found