|
|
|
|
|
by derefr
2314 days ago
|
|
The point of cat(1), short for concatenate, is to feed a pipeline multiple concatenated files as input, whereas shell stdin redirection only allows you to feed a shell a single file as input. This is actually highly flexible, since cat(1) recognizes the “-“ argument to mean stdin, and so you can `cat a - b` in the middle of a pipeline to “wrap” the output of the previous stage in the contents of files a and b (which could contain e.g. a header and footer to assemble a valid SQL COPY statement from a CSV stream.) |
|
This is the conceptual difference between
and Opening files isn't really something I think of cat as doing in its capacity as cat. It's something all the command line utilities do equally.