Re: 1 liner question

2004-02-25 Thread John W. Krahn
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 > "

Re: 1 liner question

2004-02-25 Thread WC -Sx- Jones
chad kellerman wrote: Sx, /usr/bin/quota michele | perl -ne 'if(/none$/){print "9\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... Otherwi

Re: 1 liner question

2004-02-25 Thread chad kellerman
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 qu

Re: 1 liner question

2004-02-25 Thread WC -Sx- Jones
chad kellerman wrote: /usr/bin/quota michele | perl -ne 'if(/none$/){print "9\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 i

RE: 1 liner question

2004-02-25 Thread Tim Johnson
That's not really a one-liner, that's just a script with the whitespace taken out. Just my opinion, but I thought the whole point to one-liners was to try to reduce a complex operation to its most compact form so that you could just type it at the command-line when you needed it quickly. If you