Comments on What is cat abuse/useless use of cat?
Parent
What is cat abuse/useless use of cat?
Sometimes I share Unix commands online, and people chastise me for "useless use of cat" (UUOC) or "cat abuse".
My cat is quite comfy and doing very well, thank you.
What are they talking about?
Post
Especially in a pedagogical context, the issue with something like cat /dev/random | head -c 20
versus the more straightforward head -c 20 /dev/random
is that it communicates that extra ceremony is necessary. It isn't. Using one program instead of two isn't about saving kilobytes of computer memory; it's about saving human thought.
Different brains are going to work differently, and if yours is ridged such that you need that extra program in there, have a great time with that. But it's simply a fact that the cat
is useless in that context—even a program that only accepts input from stdin can be written fooprog </dev/random
—and most people in tech culture prefer to remove useless components from their tech.
0 comment threads