bug-bash
[Top][All Lists]
Advanced

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

Re: Command substitution fails in here-document delimiter.


From: Lawrence Velázquez
Subject: Re: Command substitution fails in here-document delimiter.
Date: Tue, 13 Jul 2021 19:22:33 -0400

> On Jul 13, 2021, at 4:37 PM, Paul Gilmartin <paulgboulder@aim.com> wrote:
> 
> Description:
>       When "word" in here-document contains command substitution,
>       bash reports an error:
> here: line 4: warning: here-document at line 2 delimited by end-of-file 
> (wanted `foo$( true )bar')
>       Man bash shows:
>    Here Strings
>        A variant of here documents, the format is:
> 
>               [n]<<<word
> 
>        The word undergoes tilde expansion, parameter and variable expansion, 
> command substitu‐
>        tion,  arithmetic  expansion, and quote removal.


Here-strings are not here-documents, so you've been reading the
wrong section of the man page.  The section on here-documents makes
it clear that the behavior you've observed is not a bug.

    Here Documents

        [...]

        The format of here-documents is:

            [n]<<[-]word
                here-document
            delimiter

        No parameter and variable expansion, command substitution,
        arithmetic expansion, or pathname expansion is performed
        on 'word'.


-- 
vq


reply via email to

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