5 ms·
Yes, you can re-write it without using cat, but many people (including me) think it's clearer to read from left-to-right. Plus the mixing of sending the file t
by mason55 6y ago
Yes, you can re-write it without using cat, but many people (including me) think it's clearer to read from left-to-right. Plus the mixing of sending the file through stdin and then using a pipe always makes my brain pause.
I just personally find that using cat as the first part of the pipeline makes everything easier.
Plus, if you're going to argue against useless use of cat, there's also no reason to send the file in through stdin. jq can read the file directly.
- hombre_fatal 6y agoAgreed. Keeping the source on the far left (whether cat or curl) just makes things easiest to follow.
- amake 6y agoYou can put `<json` on the left no problem. (But it makes the pipeline harder to edit so actually I have no problem with `cat JSON`)