Re:Stop Piping Cats
by barrkel on Wednesday February 10, 2010 @05:51PM
(#1116288)
At the expense of the data flowing from right to left to right, from the outside in. At least with cat, data flows unambiguously from left to right.
[ Parent
| on HN ]
But using cat totally fucks up the calling conventions: it puts the operand as the second of many arguments. Which one of these doesn't belong?:
verb file
cat file | verb1 | verb2 | verb3
(verb1 | verb2 | verb3) < file
verb123 file
EDIT: Consider the calling conventions, which one of these handles it's arguments differently? Assume that verb123 is an equivalent to the pipeline -- the subshell+stdin construction lends itself to shell aliases: alias verb123="(verb1 | verb2 | verb3) < "I have no idea which one doesn't belong. Is 'verb123' the moral equivalent of '(verb1 | verb2 | verb3)'? In that case, it's the first one. But that's visible from the first word on the line, so I'm still not getting the picture.
Of course, with the usual argument vs stdin conventions, either of the middle two could also be rewritten:
verb1 file | verb2 | verb3
This is probably how I'd write such a chain.