kwik way?

Warren Block wblock at wonkity.com
Wed May 18 22:06:08 UTC 2011


On Wed, 18 May 2011, Devin Teske wrote:

> In case you were thinking of either awk or perl, I'd recommend against those
> given the following results:
>
...
>
> $ time sh -c "perl -pe 'tr/\t/ /' < foo > bar"
> real    0m0.565s
> user    0m0.277s
> sys     0m0.137s
> $ md5 bar
> MD5 (bar) = f0187bcbc37cd6d84c6f5cadc6443843

While Perl is a quarter of a second slower than best-case sed, it does 
offer the ability to directly understand \t (and \n, and lots of other 
escapes).


More information about the freebsd-questions mailing list