Sx,
This script goes into a procmail recipe I was working on. It's
running on linux. If you run quota for a user and the quota is not set
it returns actually returns none and I just print the 9's to signify
that.
If the user has quota on multiple partitions, the quota command prints
the quota on separate lines, I wanted to add the quota for each
partition ( each line of the output of the quota command) and say this
is the total quota for the user.
But the way I have it now it prints the quota (in bytes) on multiple
lines ( one for each partition). I was hoping to take the values and add
them together, but I can't seem to get it right.
But I did not realize this is not an "appropriate" topic for this
mailing list. I apologize for that..
Anyways, thanks for the help.
Chad
On Wed, 2004-02-25 at 14:55, WC -Sx- Jones wrote:
> chad kellerman wrote:
>
> > /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"}'
>
> Is none a reserved word now?
>
> I ask because quota doesnt return the same values across Unix opsys...
>
> Otherwise if the vaslues are in $q and $l - why not add them?
> -Sx-
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>