Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [bug] Globbing fails with execute-only directory in path
- X-seq: zsh-workers 42563
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Tatsuyuki Ishi <ishitatsuyuki@xxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Mikael Magnusson <mikachu@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [bug] Globbing fails with execute-only directory in path
- Date: Thu, 29 Mar 2018 11:23:39 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=u/rtNo/2xi0XyipRSf9UfJwT/mxxAr4P3cj3JJ9GsKw=; b=Mtut5mF/Yp9MVEEEy2ZMJCvOCChqdOJ99ibW7cNhy+Gpgeq0Ojt9/ie2rdPU5rj6tY oMbMDb+2tRoWSXQ0g5QJ9piXtH14M/dInDL7gTFBbP1MnNz8oqRILoS+lNtquUyiVTEc CZ3D5NdpkF7JOVoM9KHQHPIjLNv9RLNgYQsoPVj1XaCYyMgOcbTkUamNU59hffauJNBD 3MKN2TJO2r/DJVirSbDooPa0jNGzCm26Y3J/RCPi42R9vi0IMJVZPrKUApxbkGJFtGhG 2d5Enu+QBq3bMeX+QTw9Zq8QufS6g+PAUJTN8LyXlGrFGCFvz4YSY3ZgK8opAvdP8iUH pdsA==
- In-reply-to: <20180329063707.GA8243@chaz.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Tatsuyuki Ishi <ishitatsuyuki@xxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Mikael Magnusson <mikachu@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CANqewP0Rb=yKiKzME3Xg6DX9H75a6-y=sH4QcoArTu8zsbmNgQ@mail.gmail.com> <CAHYJk3TzH7tyv4wdXgCCiAUctto_b8+-P95EAmrLbgtf19c+TQ@mail.gmail.com> <CAH+w=7aSHnmmpaj1drNVNGtgPqFUmDMgTSVxcFeggrbvSdMepw@mail.gmail.com> <CANqewP0_t3btJ0w8Mhs9XRE3N5pWKZrxtf9+UC4WR+0fOzxODg@mail.gmail.com> <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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author