3 ms·
And for people like me who want the file name first on the line, this format works in Bash at least: </dir/file sort | uniq >outfile
by BenjiWiebe 8y ago
And for people like me who want the file name first on the line, this format works in Bash at least:
</dir/file sort | uniq >outfile
- fiddlerwoaroof 8y agoI always find it really confusing when the command-line begins with a redirect.
- unixhero 8y agoYes, how do you parse that - ie. what does it even mean?
- fiddlerwoaroof 8y agoIt's just a convention that redirects come after the command they're redirecting. There might be shell options that influence this, but I think all these are generally equivalent: foo bar < a foo < a bar < a foo bar
- paxunix 8y agoIt is POSIX shell parsing behaviour that redirections can appear anywhere in the command (obviously, not in the same word as another parameter, nor inside a quoted string). They have to be stripped out by the shell before execution: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07 http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3...
- moviuro 8y ago> a # from stdout to file < a # simply the opposite operation: from file to stdin