3 ms·
It is the thing it was designed for: CAT(1) concatenate [one or more] files and print on the standard output A list of length one is still a list. It
by globular-toast 2y ago
It is the thing it was designed for:
CAT(1)
concatenate [one or more] files and print on the standard output
A list of length one is still a list. It's best to write code that can handle lists of any size, not to write special cases that handle a fixed number of primitives.
You can swap `cat` for `zcat`, for example, and things still work in just the same way. This would be very awkward to do with input redirection.
Maybe using `cat` like this appeals to people with more of a functional programming exposure.
If we were going to completely change the shell behaviour I think `file > grep` makes more sense than `file | grep`.