On Sat, Oct 17, 2020 at 3:48 PM Craig H Maynard <chmayn...@me.com> wrote:

> Hi,
>
> In section 3.5.4 "Command Substitution", the following sentence may have a
> typo:
>
> > The command substitution $(cat file) can be replaced by the equivalent
> but faster $(< file).
>
>
> My proposed change:
>
> > The command substitution $(cat file) can be replaced by the equivalent
> but faster <(cat file).
>
>
> If the manual is correct and I misunderstood something, please let me know.
>

Hi Craig,

<(cat file) and $(cat file) are not equivalent constructs. The former will
expand to a file name (e.g. "/dev/fd/63"), whereas the latter will expand
to the contents of the file.


In the case of   $(cat file)  and $(< file), they are equivalent, except
that in the second case there's no external command ("cat"), and instead
Bash reads the file and does the expansion itself.

Reply via email to