I get it now. Thanks for your friendly and informative replies. :)

Craig


> On Oct 17, 2020, at 7:45 PM, Lawrence Velázquez <v...@larryv.me> wrote:
> 
>> On Oct 17, 2020, at 7:35 PM, Eduardo Bustamante <dual...@gmail.com> wrote:
>> 
>> <(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.
> 
> If you want terms you can look up, $(cat file) and $(< file) are
> *command substitutions*, while <(cat file) is a *process substitution*.
> 
> $ printf 'FILE CONTENTS' >tmp
> $ printf '|%s|\n' "$(cat tmp)"
> |FILE CONTENTS|
> $ printf '|%s|\n' "$(< tmp)"
> |FILE CONTENTS|
> $ printf '|%s|\n' "<(cat tmp)"
> |<(cat tmp)|
> $ printf '|%s|\n' <(cat tmp)
> |/dev/fd/63|
> 
> 
> --
> vq


Reply via email to