I've long been fascinated by the prevalence of
cat file | process
and think of it as a sort of triumph of the model. Pipes are more natural than redirection as a human interface.
This has always struck me as particularly elegant in scripts. Consider:
cat "$@" | whatever
(Or you may prefer `cat $* | whatever`)
Now one's script can take any number of file arguments or stdin, even if the filter does not.
- Dan C.
On Thu, 3 Dec 2020, Larry McVoy wrote:
> Wasn't there a version that was
>
> cat whatever ^ wc -l
Sort of pipe-related, but one thing that really gets my goat is the
inefficient redundancy in "cat file | process" when "process < file" will
suffice (and I'll bet that I'm not alone).
And yes, "^" preceded "|" for reasons discussed later in this thread.
-- Dave