Re: Inconsistent handling of patterns with backslah (`\`) escaping

Chet Ramey <[email protected]> Mon, 1 Jun 2026 09:50:43 -0400
Newsgroups gmane.comp.shells.bash.bugs
Organization ITS, Case Western Reserve University
Message-ID <[email protected]>
On 5/31/26 5:36 PM, Robert Elz wrote:

> The best thing to do when deciding if a word needs filename expansion or
> not, is to simply ignore any \ in the word, if it contains what look like
> pattern chars (? * [) then apply filename expansion, if some of what were
> thought initially to be pattern chars turn out not to be, then that's OK
> (and having acted as an escape, if that is what happened, a \ will vanish).

I changed bash-5.0 to do that, since that is essentially what POSIX said
at the time, and everyone decided that was wrong.

We had a rocking discussion:

https://www.austingroupbugs.net/view.php?id=1234

and converged on the current behavior, which seems to be present in all shells.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc (application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE-----

wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCah2OMwUDAAAAAAAKCRC7WGnwZOp0q0AK
AJ0fsvFieAQhaR43d0uZ9b6JLyBTTACfZIzIopY1KSqGMuch24GTJguYQaM=
=ZVSi
-----END PGP SIGNATURE-----