4 ms·
The dictionary defines it as "link together in a chain or series", but in practice on many UNIX systems it's come to mean simply, 'write to stdout' which unless
by chrisfinazzo 6y ago
The dictionary defines it as "link together in a chain or series", but in practice on many UNIX systems it's come to mean simply, 'write to stdout' which unless you get into redirection, is just a user's terminal.
I get that the big metaphor was 'small pieces, loosely joined', but this one has always seemed half-baked to me - e.g, it's often too small to be useful without a bit more effort by you, the person typing things.
- saagarjha 6y agoHey, some people do use it to combine files!
- chrisfinazzo 6y agoI'm not arguing that, but to do what most people think of w.r.t what comes to mind when you talk about cat requires redirection. From the man page: The command: cat file1 will print the contents of file1 to the standard output. The command: cat file1 file2 > file3 will sequentially print the contents of file1 and file2 to the file file3, truncating file3 if it already exists. See the manual page for your shell (i.e., sh(1)) for more information on redirection.
- konjin 6y agoI'll have you know I had to use cat and tac in the way they were intended a few days ago. I can't remember for the life of me why, but I was shocked.
- chrisfinazzo 6y agoHuzzah. You win this round.
- kevinmgranger 6y agoTo be fair, it's still linking one file together with... uh, nothing.
- mprovost 6y agocat has been (ab)used to output files to a terminal for a long time. BSD 1 has a program cat3a [0] that Bill Joy wrote in 1977(!) to quickly write files to an ADM-3A terminal [1]. If you look at the keyboard it has arrows on the HJKL keys which is where vi got its navigation from. (Also the escape key was next to Q!) [0] https://github.com/dspinellis/unix-history-repo/blob/BSD-1-Snapshot-Development/s6/cat3a.c https://github.com/dspinellis/unix-history-repo/blob/BSD-1-S... [1] https://en.wikipedia.org/wiki/ADM-3A https://en.wikipedia.org/wiki/ADM-3A