by hiAndrewQuinn · 2y ago · 0 comments
`Y x | Z` is Verb-Subject-Object.
That's why I prefer using cat "uselessly".
< x Y | Z > w
Y takes input redirected from x, piped into Z, which outputs into w.I.e.
x | Z | tee w | Y
? that's... something else entirely. < x Y | Z > w
where x and w are files, not commands.Something that "cat file | ..." advocates might be overlooking is that a redirection ("<inputfile", ">outputfile", "2>errorfile") can appear anywhere within a simple command, so these:
command -option < file
< file command -option
command < file -option
are all exactly the same -- and of course very similar to cat file | command -option
If the purpose of typing "cat file | command" is to put the input file at the beginning (which does make logical sense), you can achieve the same thing with "< file command". Admittedly, it does look at bit strange if you're not accustomed to it. (It even works with csh and tcsh.) < <(curl http://...) command -option
Because that's what you get if you address the actual argument and still insist on input redirection.Input redirection is inconsistent with every other command to retrieve data. Not only does it not have the same syntax, it's combining two actions into one step of the pipeline.