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

Re: [bug] Globbing fails with execute-only directory in path



2018-03-29 07:37:07 +0100, Stephane Chazelas:
[...]
> That reveals another difference between zsh and bash here (or
> more like between bash and other shells):
> 
> $ mkdir -p a/b/cd
> $ zsh -o nocaseglob -c 'echo a/B/c*'
> a/b/cd
> $ yash -o nocaseglob -c 'echo a/b/C*'
> a/b/cd
> $ ksh93 -c 'echo ~(i)a/b/C*'
> a/b/cd
> $ bash -O nocaseglob -c 'echo a/B/c*'
> a/B/c*
> 
> yash manages to find a/b/cd here after I remove search
                                                  read
> permission to "a":
> 
> $ chmod 111 a
> $ ksh93 -c 'echo ~(i)a/b/C*'
> ~(i)a/b/C*
> $ yash -o nocaseglob -c 'echo a/b/C*'
> a/b/cd
[...]

Sorry, my bad, I hadn't realised that was the wrong test case
for yash. yash does behave like bash here:

$ yash -o nocaseglob -c 'echo a/b/C*'
a/b/cd
$ yash -o nocaseglob -c 'echo a/B/C*'
a/B/C*
$ zsh -o nocaseglob -c 'echo a/B/C*'
a/b/cd

So it works for the chmod 111 case for the same reason as it works in bash:
it's doesn't need to list directory at every path components to find matching
files.

In effect, in zsh

echo a/b/c*

is like:

echo [aA]/[bB]/[cC]*

And that command fails to match in every shell when "a" is not readable.

-- 
Stephane



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