1

In bash it's possible to put a file as an argument using the form "$(< file)". Where is the documentation for the presumably special casing of $(<?

Matt Joiner
  • 112,946
  • 110
  • 377
  • 526

1 Answers1

3

It's in the man page, under "Command substitution":

Command Substitution
       Command substitution allows the output of a command to replace the com-
       mand name.  There are two forms:

              $(command)
       or
              `command`

       Bash performs the expansion by executing command in a subshell environ-
       ment and replacing the command substitution with the standard output of
       the command, with any trailing newlines deleted.  Embedded newlines are
       not deleted, but they may be removed during word splitting.   The  com-
       mand  substitution  $(cat  file)  can be replaced by the equivalent but
       faster $(< file).
Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
chepner
  • 497,756
  • 71
  • 530
  • 681