AWK experts - how would I code around this in awk...

Steve Flynn anothermindbomb at gmail.com
Tue Feb 23 15:54:33 UTC 2010


On Sun, Feb 21, 2010 at 7:48 PM, Doug Robinson <dkrr at telus.net> wrote:

> My guess is that it will prove fastest esp. with a multi core cpu;
> common these days.

Sample file of 1,375,031 lines. Output set to 20 characters.


tr piped into fold

real    0m18.61s
user    0m15.38s
sys     0m2.46s


Perl version:

real    0m41.25s
user    0m39.09s
sys     0m2.06s



Output set to 32768 bytes:

tr | fold fails as with "Invalid number". Manual page mages no
reference to a maximum value, oddly enough.


Perl version:

real    0m4.80s
user    0m2.97s
sys     0m1.64s


As exepct, tr and fold is a lot faster, when it works! :) Perl wins
for "just working".

-- 
Steve
When one person suffers from a delusion it is insanity. When many
people suffer from a delusion it is called religion.

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0




More information about the ubuntu-users mailing list