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 really want to do it that way, then you should just put
the whitespace back in, get the script to work, and then take it out
again.

Really, though, one-liners are for the most part beyond the scope of a
beginners list.
 


-----Original Message-----
From: chad kellerman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 25, 2004 11:29 AM
To: '[EMAIL PROTECTED]'
Subject: 1 liner question

Hello everyone...

    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"}'

--
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