bug-bash
[Top][All Lists]
Advanced

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

Re: BUG: Here-doc delimiter: unclosed quotes


From: Chet Ramey
Subject: Re: BUG: Here-doc delimiter: unclosed quotes
Date: Fri, 19 Jan 2024 17:22:04 -0500
User-agent: Mozilla Thunderbird

On 1/18/24 9:16 AM, Dastan Abdygali wrote:

Bash Version: 5.2
Patch Level: 0
Release Status: release

Description:
         If unclosed single quotes or unclosed double quotes are used as a
delimiter in here-doc, bash lets the user finish the quote on
         the next lines. As a result delimiter contains \newline character.
Which even if pasted does not trigger the
         here-doc to be concluded.

A here-document delimiter containing a newline can never work: the
delimiter has to appear on a line by itself, immediately followed by a
newline, to be recognized. Some of the ash-based shells accept delimiters
with embedded newlines, but bash never has.

I've considered adding a warning for this or making it a fatal syntax
error like yash, but never done it.

--
``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]