> You write "cat filename" and you can free your mind and focus on the rest of the pipes. Without cat, you have to keep filename in your mind while you write the first command.
In bash (don't know about other shells) the < operator sets the stdin of the process to the given file.
< filename.json jq
Here, data is read directly from the given file.
As for the | operator, the stdout of the left-hand process and the stdin of the right-hand process become a pipe:
cat filename.json | jq
Here, data is read from file, copied to a pipe buffer, the other process is
notified (in most cases, by being woken up) that there is incoming data and then it finally reads the data.
Not that any of this matters in today's world of pocket supercomputers but I just don't see how any of your points back up the useless use of cat. It's still useless :)
The cat and pipe are semantically easier to understand though, at least that has been my experience when onboarding new hires.
While Bash has all sorts of nice bells and whistles for various use-cases, I really think they are only worth relying on when you are doing something highly specific. In general mastering wildcards and pipes is sufficient for the vast majority of situations, I think for everything else it's better to use commands that people can easily search or find the man page for.
In the world of pocket supercomputers as you called it, interface is king. So I'd argue that if anything, `<` is the useless one here when we can could just have just used the more semantically obvious cat and pipe instead.
In bash (don't know about other shells) the < operator sets the stdin of the process to the given file.
Here, data is read directly from the given file.As for the | operator, the stdout of the left-hand process and the stdin of the right-hand process become a pipe:
Here, data is read from file, copied to a pipe buffer, the other process is notified (in most cases, by being woken up) that there is incoming data and then it finally reads the data.Not that any of this matters in today's world of pocket supercomputers but I just don't see how any of your points back up the useless use of cat. It's still useless :)