News for hackers. Stuff that matters.
Re:The Useful Use of Cat by latexr on Monday October 21, 2024 @05:25AM (#41902217)
> Using `cat file.txt | ...` has always felt more natural to me

Use whatever you prefer¹, but if what you care for is the logic of reading left to right, you can do so without `cat` by doing instead `< file.txt | ...`

¹ It’s absurd this needs to be spelled out, but here we are.

Re:The Useful Use of Cat by oneeyedpigeon on Monday October 21, 2024 @05:34AM (#41902280)
They're saying they find "cat" more natural than "<" which I can understand. Unless you regularly use "<", it's probably easier to remember "cat" and it's more self-documenting.
Re:The Useful Use of Cat by latexr on Monday October 21, 2024 @05:50AM (#41902396)
> They're saying they find "cat" more natural than "<" which I can understand.

I don’t think that’s what they’re saying. I think they’re making the point that going left to right with the file first is what makes sense to them, as opposed to `... < file.txt`.

Re:The Useful Use of Cat by oneeyedpigeon on Monday October 21, 2024 @05:53AM (#41902422)
You're assuming they don't know about `<file.txt ...` That may be the case, but I can still see an argument for "cat" being more natural than "<" in this context.
Re:The Useful Use of Cat by latexr on Monday October 21, 2024 @06:09AM (#41902512)
> You're assuming they don't know about `<file.txt ...`

And you’re assuming they do. It’s safe to assume at least one person reading the comment won’t know about the feature, the information is useful to more than that poster.

> but I can still see an argument for "cat" being more natural than "<" in this context.

You’re also assuming I don’t understand that sentiment. That has nothing to do with my original post. I don’t care what you use, do whatever makes you happiest. I was merely offering an alternative that would still satisfy what I perceived to be the original point (command piping left to right) to share knowledge, I was in no way criticising their method or saying they shouldn’t use it.

This is a useless conversation.

Re:The Useful Use of Cat by knighthack on Monday October 21, 2024 @05:51AM (#41902410)
I don't care about fancy '<' syntaxes.

I want to type 'cat'.

The visual imagery of summoning a cute cat to do my POSIX sorcery trumps all else.

Re:The Useful Use of Cat by latexr on Monday October 21, 2024 @06:12AM (#41902534)
> I want to type 'cat'.

Then do. I’m certainly not stopping you, or saying you’re wrong to do it. I offered an alternative with no judgement for the other method.

Re:The Useful Use of Cat by kazinator on Monday October 21, 2024 @02:53PM (#41907185)
Since when can you summon a real cat using the word cat? Or any word?
Re:The Useful Use of Cat by Arcuru on Monday October 21, 2024 @11:44AM (#41905373)
No I can't. Because I use fish shell. `cat` can also be a single character if you alias it :)