[olug] Unix Tip: OUTPUT A FILE IN REVERSE

William E. Kempf wekempf at cox.net
Mon Apr 28 13:59:06 UTC 2003


Kenton Brede said:
> On Tue, Apr 22, 2003 at 09:48:17AM -0500, William E. Kempf wrote:
>>
>> Thom Harrison said:
>
> <snip>
>> 3) Why in the world is this a seperate program?  (If there is a need
>> for this sort of thing, shouldn't it be a command line switch on cat?)
> <snip>
>
> There is a short book that may help answer this question for you.  It is
> called, "The Unix Philosophy" by Mike Gancarz.  The answer would fall
> under number one and two of the "nine major tenets":
>
> 1. small is beautiful
> 2. make each program do one thing well

Uhmm... bull hockey.  The added overhead involved by making this a
seperate program can not justify this choice.

1. cat --reverse would still be small (and would be significantly smaller
than the combination of cat and tac).
2. I'd argue that printing in reverse is not additional functionality,
only a variation on what cat already does.  If I applied your logic to
reversing, I'd have to apply it to numbering lines as well, and so the
design would still be screwed, just in a different way.

I understand the "Unix Philosophy", and have heard it touted before, but I
don't think it was properly applied in this case.

-- 
William E. Kempf




More information about the OLUG mailing list