From Bash Manual:
The command substitution
$(cat file)
can be replaced by the equivalent but faster$(< file)
.
cat
is from coreutils, instead of a bash builtin command.
So I am surprised that the bash manual would mention something outside bash, such as cat
.
Is $(< file)
really a shorthand of $(cat file)
?
Is $(< file)
completely bash, or does $(< file)
really depend on cat
?
If $(< file)
is completely bash, and doesn't depend on cat
,
- is
< file
a redirection or a command or both (a command with a redirection and an empty command name)? - how can
< file
(a command with a redirection and an empty command name) output to stdout?
Thanks.