[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash-5.1-beta available
From: |
Chet Ramey |
Subject: |
Re: Bash-5.1-beta available |
Date: |
Sun, 13 Sep 2020 14:29:15 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
On 9/13/20 8:21 AM, Andreas Schwab wrote:
> On Sep 10 2020, Chet Ramey wrote:
>
>> qqq. Fixed a bug that could cause backslashes quoting double quotes in here
>> document bodies to not be removed when expanding the body.
>
> Are you sure about this? My reading of POSIX says that a backslash
> before a double quote should not be removed, as double quotes are not
> special in here docs.
The specific construct is
P=A
cat <<EOF
${P+\"$P\"}
EOF
from https://lists.gnu.org/archive/html/bug-bash/2019-01/msg00193.html .
In this case, the usual proscription on double quotes in here-documents
does not apply, since the double quote appears within ${}.
This change makes the above and
echo "${P+\"$P\"}"
echo the same thing.
The bash-5.1 behavior is consistent with what other shells claiming POSIX
conformance, except the BSD ash-based shells, produce. There's pretty wide
variance in behavior between shells with all of the variants of putting a
double quote inside a parameter expansion inside a here-document, and
POSIX has basically thrown its hands in the air in disgust.
--
``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/
- Re: Bash-5.1-beta available, (continued)
- Re: Bash-5.1-beta available, Andreas Schwab, 2020/09/11
- Re: Bash-5.1-beta available, Jesse Hathaway, 2020/09/11
- Re: Bash-5.1-beta available, Oğuz, 2020/09/11
- Re: Bash-5.1-beta available, Chet Ramey, 2020/09/11
- Re: Bash-5.1-beta available, Dale R. Worley, 2020/09/21
- Re: Bash-5.1-beta available, felix, 2020/09/23
- Re: Bash-5.1-beta available, Andreas Schwab, 2020/09/13
- Re: Bash-5.1-beta available,
Chet Ramey <=
- Re: Bash-5.1-beta available, Robert Elz, 2020/09/13
- Re: Bash-5.1-beta available, Chet Ramey, 2020/09/14
- Re: Bash-5.1-beta available, Robert Elz, 2020/09/14
- Re: Bash-5.1-beta available, Chet Ramey, 2020/09/15
- Re: Bash-5.1-beta available, Robert Elz, 2020/09/15
- Re: Bash-5.1-beta available, Chet Ramey, 2020/09/16
- Re: Bash-5.1-beta available, Robert Elz, 2020/09/16
- Re: Bash-5.1-beta available, Chet Ramey, 2020/09/17