bug-bash
[Top][All Lists]
Advanced

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

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


From: Chet Ramey
Subject: Re: Inconsistent handling of patterns with backslah (`\`) escaping
Date: Mon, 1 Jun 2026 11:43:11 -0400
User-agent: Mozilla Thunderbird

On 6/1/26 11:24 AM, Grisha Levit wrote:
On Mon, Jun 1, 2026, 11:14 Chet Ramey <chet.ramey@case.edu> wrote:

On 6/1/26 6:54 AM, Andrei Borzenkov wrote:
On Sun, May 31, 2026 at 5:32 PM Andreas Schwab <schwab@linux-m68k.org> wrote:

Because '\*' is not a glob, so filename expansion is not performed.


Actually it is. Pathname expansion is performed on the result of the
parameter expansion and pathname expansion interprets the current
content of the word in question as pattern:

It's not, since the `*' in the word is not "treated as special" with
respect to pattern matching.

Or maybe one could say that pathname expansion is "performed," but is a
no-op, per #4 of the list in 2.14.3:

     If a specified pattern does not contain any '*', '?' or '['
     characters that will be treated as special, the pattern string
     shall be left unchanged

Yes, pretty much the same thing, but I like the rationale because it says
the matching doesn't take place at all if the special pattern character
isn't treated as special (just a little more straightforward).

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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