bug-bash
[Top][All Lists]
Advanced

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

Changed behaviour of ${PARAMETER/#PATTERN/STRING} and ${PARAMETER/%PATTE


From: Andreas Schwab
Subject: Changed behaviour of ${PARAMETER/#PATTERN/STRING} and ${PARAMETER/%PATTERN/STRING}
Date: Mon, 13 May 2024 18:04:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

In 5.3-alpha, it is no longer possible to quote the special % and #
characters in a pattern replacement expansion.

$ a=1/%2/%3
$ echo "${a/\%/##}"
1/%2/%3##
$ echo "${a/\/%/##}"
1##2/%3

The second example shows that quoting still works as expected for
${PARAMETER//PATTERN/STRING}.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



reply via email to

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