dumb newbie questions

Jonathan Gardner jgardn at alumni.washington.edu
Thu Jan 17 17:31:14 EST 2002


> >
> > $ cat matrix.txt | python inverse.py
>
> or, to avoid creating an unnecessary process,
>
> $ python inverse.py < matrix.txt
>

Yeah, you can do that. But when I was a newbie to unix, I always would try to 
do something stupid like this:

$ some_prog < grep "something" some_file

"But it works for you! Why can't I do this?" - me, to unix guru

And it didn't help when I did something really stupid like:

$ some_prog > head

and wonder why it didn't show a head for me!

"Where did this 'head' file come from? Is it a trojan horse?" - me

So remember, boys and girls, use '<' and '>' for files, and '|' for 
processes.

"Power comes from the end of a pipe" is what Mao Tsetung would have said if 
he knew about Unix.

Jonathan




More information about the Python-list mailing list