From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>,
Bart Schaefer <schaefer@brasslantern.com>,
Mikael Magnusson <mikachu@gmail.com>,
Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [bug] Globbing fails with execute-only directory in path
Date: Thu, 29 Mar 2018 11:23:39 +0100 [thread overview]
Message-ID: <20180329102339.GA12710@chaz.gmail.com> (raw)
In-Reply-To: <20180329063707.GA8243@chaz.gmail.com>
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
prev parent reply other threads:[~2018-03-29 10:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-28 13:35 Tatsuyuki Ishi
2018-03-28 16:54 ` Mikael Magnusson
2018-03-28 17:00 ` Bart Schaefer
2018-03-29 0:00 ` Tatsuyuki Ishi
2018-03-29 6:37 ` Stephane Chazelas
2018-03-29 10:23 ` Stephane Chazelas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180329102339.GA12710@chaz.gmail.com \
--to=stephane.chazelas@gmail.com \
--cc=ishitatsuyuki@gmail.com \
--cc=mikachu@gmail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).