> One of my pet peeves is "The Useless Use of cat Award". Someone awarded it to me as a teenager in the late 90s and I've been sore ever since.
Wear it as a badge of honor! It marks you as a person who puts clarity, convenience and simplicity before raw performance. I can't think of a single case when that bit of performance matters.
Needless to say, I'm happily using cat (uselessly) myself and have no plans to convert.
> It marks you as a person who puts clarity, convenience and simplicity before raw performance.
This. As noted, even in scripts it usually makes more sense since the result is a pipeline that's easier to read, annotate and modify.
Case in point:
cat file.txt \
| sed '1s/^\xEF\xBB\xBF//' `# Strip UTF-8 BOM at the beginning of the file` \
| ...
Specifying a file name would only make the "black-magic-line" of `sed` more complicated while also making it more complicated to modify the pipeline itself. Now, if I want to skip that step to test something, I don't have to figure out if/how the next command takes an input file (or, ironically, replace `sed` with `cat`).
Wear it as a badge of honor! It marks you as a person who puts clarity, convenience and simplicity before raw performance. I can't think of a single case when that bit of performance matters.
Needless to say, I'm happily using cat (uselessly) myself and have no plans to convert.