[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string substitution broken since 5.2
From: |
Chet Ramey |
Subject: |
Re: string substitution broken since 5.2 |
Date: |
Thu, 3 Nov 2022 14:50:00 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 |
On 11/3/22 1:32 PM, thierryb--- via Bug reports for the GNU Bourne Again
SHell wrote:
Bash Version: 5.2
Patch Level: 2
Release Status: release
Description:
String substitution code running for years is broken in 5.2.
Repeat-By:
string = 'xdotool type "sudo apt update"'
string="${string//\"/"}"
printf '%s' "$string"
previously outputs:
xdotool type "sudo apt update"
but now outputs:
xdotool type "quot;sudo apt update"quot;
From NEWS:
x. New shell option: patsub_replacement. When enabled, a `&' in the replacement
string of the pattern substitution expansion is replaced by the portion of
the string that matched the pattern. Backslash will escape the `&' and
insert a literal `&'.
The option is enabled by default. If you want to restore the previous
behavior, add `shopt -u patsub_replacement'.
--
``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/
- string substitution broken since 5.2, thierryb, 2022/11/03
- Re: string substitution broken since 5.2, Andreas Schwab, 2022/11/03
- Re: string substitution broken since 5.2, Koichi Murase, 2022/11/03
- Re: string substitution broken since 5.2, Greg Wooledge, 2022/11/03
- Re: string substitution broken since 5.2, Koichi Murase, 2022/11/03
- Re: string substitution broken since 5.2, Greg Wooledge, 2022/11/03
- Re: string substitution broken since 5.2, Greg Wooledge, 2022/11/03
- Re: string substitution broken since 5.2, Koichi Murase, 2022/11/03
Re: string substitution broken since 5.2, Thierry B., 2022/11/03
Re: string substitution broken since 5.2,
Chet Ramey <=
- Re: string substitution broken since 5.2, Léa Gris, 2022/11/04
- Re: string substitution broken since 5.2, Alex fxmbsw7 Ratchev, 2022/11/04
- Re: string substitution broken since 5.2, Greg Wooledge, 2022/11/04
- Re: string substitution broken since 5.2, Alex fxmbsw7 Ratchev, 2022/11/04
- Re: string substitution broken since 5.2, Greg Wooledge, 2022/11/04
- Re: string substitution broken since 5.2, Alex fxmbsw7 Ratchev, 2022/11/04
- Re: string substitution broken since 5.2, Chet Ramey, 2022/11/04
- Re: string substitution broken since 5.2, Alex fxmbsw7 Ratchev, 2022/11/04
- Re: string substitution broken since 5.2, Alex fxmbsw7 Ratchev, 2022/11/04
Re: string substitution broken since 5.2, Chet Ramey, 2022/11/04