[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string substitution broken since 5.2
From: |
Koichi Murase |
Subject: |
Re: string substitution broken since 5.2 |
Date: |
Fri, 4 Nov 2022 03:31:44 +0900 |
2022年11月4日(金) 2:50 Andreas Schwab <schwab@linux-m68k.org>:
> On Nov 03 2022, thierryb--- via Bug reports for the GNU Bourne Again SHell
> wrote:
> > 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;
>
> shopt -u patsub_replacement
Another option is to quote `&' in the replacement if you want to make
it work regardless of the 5.2 feature, patsub_replacement:
string="${string//\"/\"}"
- 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 <=
- 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, 2022/11/03