bug-bash
[Top][All Lists]
Advanced

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

Re: Heredoc with a multiline delimiter


From: Chet Ramey
Subject: Re: Heredoc with a multiline delimiter
Date: Mon, 17 Mar 2025 09:57:05 -0400
User-agent: Mozilla Thunderbird

On 3/15/25 9:18 PM, Robert Elz wrote:

POSIX says:

        It is unspecified whether the line containing the trailing delimiter
        is itself subject to this line continuation.

which means that nothing is required to make that work.   Further, unless
bash documents it as working, it is free to change the way it works for
that at any time, so was anyone to take your advice and actually use that
method, then they'd be risking their code breaking in a subsequent release,
with perhaps no warning at all.

The current version of the man page says:

"If the delimiter is not quoted, the \<newline> sequence is treated as a
 line  continuation:  the two lines are joined and the backslash-newline
 is removed.  This happens while reading the here-document,  before  the
 check for the ending delimiter, so joined lines can form the end delim-
 iter."

I added it last September.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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