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    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to