Back to UUOC (was: Shell tips and tricks)

Lloyd Kvam python at venix.com
Fri Oct 5 13:45:49 EDT 2007


On Fri, 2007-10-05 at 11:51 -0400, Ben Scott wrote:
>   That's practically a tautology.  You're saying, "I think, 'I want to
> cat this file', so I use cat."  In other words, you use cat when you
> think of cat.  Well, duh.  :)  The real question is, "Why do you think
> of cat?"
> 
>   In my mind, I think "I want to send this file to this program".
> >From there, I'm just as likely to use "<" as I am to use "cat", but
> I'm not sure that was always the case (and my memories of my own
> memory are unclear and likely suspect (hmmm, Heisenberg's Uncertainty
> Principle as applied to introspection of my own mind (but I
> digress))).
> 
>   So why/how does "cat" become a verb meaning "send file to another
> program"?
> 
>   Is it because cat is often used to dump a program to the terminal? 

This discussion has really succeeded in drumming into my head that
        < input
        > output
        filter args
are commutative.  You can shuffle them into any order and the line
works.  (A program like cp gums things up because it is not a filter.)

< input

does nothing by itself.  It needs cat or some other process to use the
redirection.  So your fingers learn to type
        cat input
You could type 
        < input cat
but that's hardly an improvement.  Once you have the cat coordination
down, is it worth trying to keep the alternative at your fingertips?



You've probably heard this joke but I think it fits.

A mathematician and an engineer are on a desert island. They find two
palm trees with one coconut each. The engineer climbs up the first tree,
gets the coconut, and eats it. The mathematician climbs up the second
tree, gets the coconut, climbs down, walks over to the first tree,
climbs it, and puts the coconut up there. "What did you do that for?"
ask the engineer. The mathematician replies, "Now we've reduced it to a
problem we know how to solve."


-- 
Lloyd Kvam
Venix Corp
DLSLUG/GNHLUG library
http://www.librarything.com/catalog.php?view=dlslug



More information about the gnhlug-discuss mailing list