Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bug in patterns used for filename expansion (e.g. a[b/c]d)



On Tue, Oct 09, 2007 at 01:59:44PM +0100, Peter Stephenson wrote:
> Vincent Lefevre wrote:
> > zsh 4.3.4 isn't POSIX-compliant concerning filename expansion and
> > unmatched [. POSIX[*] says:
> > 
> >   For example, the pattern "a[b/c]d" does not match such pathnames as
> >   abd or a/d. It only matches a pathname of literally a[b/c]d.
> > 
> > [*] http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#t
> > ag_02_13_03
> > 
> > But with zsh 4.3.4:
> > 
> > prunille% ls a[b/c]d
> > zsh: no matches found: a[b/c]d
> 
> As I said on the Austin group list, this isn't a bug.  It's controlled
> by the option NOMATCH; you'll find that if zsh is in compatibility mode
> that option is unset.
[...]

On the other hand:

$ mkdir -p 'a[b/c]d' abd
$ zsh -c 'echo a[b/c]d'
abd
$ ARGV0=sh zsh -c 'echo a[b/c]d'
abd

According to POSIX, it should not match abd.

But I'd agree that POSIX requirement looks a bit silly.

Cheers,
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author