View Single Post
Posts: 36 | Thanked: 42 times | Joined on Jan 2010
#145
Originally Posted by Palleman View Post
NBC: I don't know how awk actually does the technical task of reading the file from disk, but are you sure it is more efficient than calling cat? Might be, might not.
It's awk's job to read file even if it's able to read from stdin (standard input).

There's even an acronym in unix world for this kind of cat use, UUOC and a wikipedia section : http://en.wikipedia.org/wiki/Cat_%28...ess_use_of_cat

It's definitely more efficient : your shell just needs to fork one external program instead of two. Ok, with a one liner it's not a big win but it's a win

While waiting for you to dig into that, I give you that your code is prettier than mine.
I enjoy pretty code !