Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Regular Expression Question

by japhy (Canon)
on Mar 27, 2001 at 23:11 UTC ( #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? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2022-12-01 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?