bug-bash
[Top][All Lists]
Advanced

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

Re: bash 5.2 bad substitution for ${x:+${x}[}


From: Chet Ramey
Subject: Re: bash 5.2 bad substitution for ${x:+${x}[}
Date: Thu, 20 Oct 2022 09:07:25 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.3

On 10/20/22 5:03 AM, Martin von Gagern wrote:

Bash Version: 5.2
Patch Level: !PATCHLEVEL!
Release Status: release

Description:

Some substitutions that used to work pre 5.2 are failing starting in
5.2. I did a git bisect on that, it's the initial 5.2 commit which
broke this, 
https://git.savannah.gnu.org/cgit/bash.git/commit/?h=bash-5.2&id=74091dd4e8086db518b30df7f222691524469998.

According to my reproducing example below, this appears to be due to a
combination of conditional substitution, a variable enclosed in curly
braces and an unbalanced opening square bracket that I think should
only be considered as text without any semantic relevance in this
position.

Thanks for the report. This came up a couple weeks ago in

https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00022.html

and is fixed in the devel branch. I've attached the patch that fixes it.

Chet

--
``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: nested-brace-expansion.patch
Description: Text document


reply via email to

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