2018-07-21 at 2:24 AM UTC
what is the standard input redirect operator < doing/good for? I have literally been thinking about this for days this week. like... i see about the wc command, but other than this isn't it redundant/vestigial?
please help, i want to learn and do a good job.. google has not been friendly
2018-07-21 at 2:50 AM UTC
I've never actually used it to do something useful, like there are plenty of use cases for redirecting input to stdin but I always cat a file and pipe it to the next process and that way you don't have to puzzle over the operator precedence. I imagine it's mostly there for symmetry with output redirection. There may also be an argument for keeping what's core functionality of "read file to command's stdin" in the shell codebase rather than a util codebase.
The following users say it would be alright if the author of this
post didn't die in a fire!
2018-07-21 at 2:53 AM UTC
aldra
JIDF Controlled Opposition
yeah, I've never actually needed it. there are probably niche cases but I've always been able to use pipe/tee in its place
2018-07-21 at 3:01 AM UTC
I almost feel like it's a cruel joke