Hacker News new | ask | show | jobs
by throwaway999888 3841 days ago
BTW, the authors effectively embraced having the functionality of using `cat` instead of < .

> The use of cat to feed a single input file to a program has to some degree superseded the shell’s < operator, which illustrates that general-purpose constructs - like cat and pipes - are often more natural than convenient special-purpose ones.

1 comments

If you're going to write shell scripts or do anything sophisticated with the shell, it's worth understanding the difference. And there is a fundamental difference. With |, standard input is hooked up to a pipe. With <, standard input is hooked up directly to the file. Sometimes it does matter.
The purpose cat serves is that it lets you forget about < until you really need it.
The comparison was between cat + pipe and < ...