Reputation:
myvar=$(<myfile)
This reads the contents of myfile
into the variable myvar
. It doesn't look like process substitution. It doesn't look like redirection since there is no command that directs into. How does this work?
Upvotes: 0
Views: 46
Reputation: 52132
From the Bash Manual, section "Command Substitution":
The command substitution
$(cat file)
can be replaced by the equivalent but faster$(< file)
.
Upvotes: 3