This question already has an answer here:
- When should I use input redirection? 2 answers
Regularly, I have seen the following syntax:
awk 'stuff' <file sort <file
The thing is, I usually write:
awk 'stuff' file sort file
And things work perfectly. So if both syntaxes are roughly equivalent (or are they?), is there any benefit from using
<file syntax ?
Existing threads cover some of my interrogations (using
< implies that the shell opens the file first and then passes it as standard input to the command), but I feel that some remain:
- POSIX compliancy ?
- Is it to dissipate any ambiguity concerning the nature of
- Is it specific to a certain type of shell ?
- Is it considered deprecated ?
- Performance-wise, is there a notable difference ?
- Any example where you would use one against the other is welcome.