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

Re: Unreadable directories aren't included in glob expansion



On Thu, 2020-01-09 at 15:41 +0000, Daniel Shahaf wrote:
> Consider:
> 
> % mkdir foo
> % mkdir -m 000 bar 
> % echo */ 
> foo/
> % echo *(/)
> bar foo
> % 
> 
> Shouldn't the expansion of «*/» include «bar/»?

Certainly, */ and *(/) have always been inconsistent and I don't know of
any fundamental reason why that needs to be.

At a practical level, the difference may have arisen because a / not in
a glob qualifier is usually present in order to select files within the
directory, which won't work if the directory isn't readable.  A glob
qualifier, on the other hand, always applies to the final path segment.

pws




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