If I run
$(</dev/stdin)
Then type echo hello world
, press enter, then Ctrl-D
We get
hello world
But why? When I think of I/O and redirection in bash, it only makes sense to me when there's an actual command. I don't understand the behavior when there's no command, and it's just < my_file
Could someone help explain/point me to a primary source that explains this further? Thanks!
$(cat file)
can be replaced by the equivalent but faster$(< file)
." – muru Jun 08 '20 at 05:06