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

Andreas Schwab <[email protected]> Sun, 31 May 2026 16:32:33 +0200
Newsgroups gmane.comp.shells.bash.bugs
Message-ID <[email protected]>
On Mai 31 2026, Andrei Borzenkov wrote:

> $ bar='\*'
> $ ls $bar
> ls: cannot access '\*': No such file or directory
> $
>
> Oops. Why it suddenly attempts to match *two* characters "\*" instead of
> just one literal "*"?

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

-- 
Andreas Schwab, [email protected]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."