News for hackers. Stuff that matters.
Re:The Useful Use of Cat by gorgoiler on Monday October 21, 2024 @01:56AM (#41901055)
It’s a hump curve with virtue signalling in the middle, like a thousand other things in life.

Noob+naive: use cat because don’t know better.

Experienced+smart ass: use shell direction to distinguish oneself from noobs.

Older+wiser: use cat again because it flows left to right, isn’t bash specific like “<file foo”, doesnt special case examples with only one file as input, and allows something other than a file as input or lifting the body of the pipeline into a function without changing the text…

…but mostly because it doesn’t make one come across as a nit picking asshole to the expensive noobs you’ve just spent months trying to hire.

Re:The Useful Use of Cat by dieulot on Monday October 21, 2024 @02:31AM (#41901228)
“<file foo” is POSIX: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V... (see the absence of mention that redirection needs to be after the command)