bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash Reference Mamual


From: Craig H Maynard
Subject: Re: Bash Reference Mamual
Date: Sun, 18 Oct 2020 16:24:30 -0400

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

Craig


> On Oct 17, 2020, at 7:45 PM, Lawrence Velázquez <vq@larryv.me> wrote:
> 
>> On Oct 17, 2020, at 7:35 PM, Eduardo Bustamante <dualbus@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

[Prev in Thread] Current Thread [Next in Thread]