Chad Kellerman wrote:
> 
> Hello everyone...

Hello,

>     I am working on a perl one liner for adding quota on multiple
> partitions.  But I can not, for the life of me get the number to add
> up..
> 
>     Here is what I have:
> 
> /usr/bin/quota michele | perl -ne 'if(/none$/){print
> "999999999\n"}elsif(m:^\s+/dev/:){($q,
> $l)=(split(/\s+/))[2,3];$t=($l-$q)*1024};next if(!$t);{print $t."\n"}'
> 
> Which prints out:
> 
> 101376
> 243280896
> 
> I want these numbers added.
> 
> Can anyone offer any suggestions?


/usr/bin/quota michele |\
perl -lane'/none$/?print+999999999:m|^\s+/dev/|and$t+=$F[2]-$F[1]}{print$t*1024'



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to