News for hackers. Stuff that matters.
Re:Useless Use of Cat Award by gav on Wednesday September 11, 2013 @11:15AM (#6367693)
As an alternative, you can always rewrite:

   cat file | grep xyz
To:

    <file grep xyz
Re:Useless Use of Cat Award by abecedarius on Wednesday September 11, 2013 @12:11PM (#6368060)
Just a cute tangent: I once wrote a shell with no built-in redirection. You executed a program named "<" for that, like your second example but with a space:

    < file grep xyz
(The trouble with this design: it doesn't generalize well to pipes.)
Re:Useless Use of Cat Award by e12e on Wednesday September 11, 2013 @11:29AM (#6367781)
No? Maybe you meant "grep xyz <file" ? In what shell does your line accomplish the same thing?

[edit: Ah, I had an extra pipe in there. "<file command args" does indeed work --- "<file | command args" does not]

Re:Useless Use of Cat Award by kps on Wednesday September 11, 2013 @11:52AM (#6367924)
>In what shell does your line accomplish the same thing?

Any descended from or cloning sh, or csh, or rc… i.e. pretty much all of them.

Re:Useless Use of Cat Award by hrwl on Wednesday September 11, 2013 @11:39AM (#6367853)

   <file grep xyz
works in bash for one.