bug-bash
[Top][All Lists]
Advanced

[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//\"/&quot;}"
> >       printf '%s' "$string"
> >
> >       previously outputs:
> >       xdotool type &quot;sudo apt update&quot;
> >
> >       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//\"/\&quot;}"



reply via email to

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