From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id fd4dce65 for ; Thu, 9 Jan 2020 21:05:58 +0000 (UTC) Received: (qmail 5029 invoked by alias); 9 Jan 2020 17:23:00 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24623 Received: (qmail 9506 invoked by uid 1010); 9 Jan 2020 17:23:00 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25684. spamassassin: 3.4.2. Clear:RC:0(209.85.221.54):SA:0(-2.0/5.0):. Processed in 1.573841 secs); 09 Jan 2020 17:23:00 -0000 X-Envelope-From: stephane.chazelas@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.221.54 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=I6sCHIcmXAuSDxGOUGnwGDbV+SmD6Jxr5SrNPRjnKug=; b=ouuAPtWmfeXgac0tfHR1F8KPtJf7IUOfc8y2pd9nagnuZdy/jeXJPYFnuz8j5oej7b PrCrdHlLJSy4Jllf6pdroUwhUHp99LHaHxhaPTMxpdbeaNyzSEXb9QukLUlP2chBhWHm 3xnasJ0gHCWy5JODXiCUrh3U5Z07aGsKtHKIv5tuf7lcOY/Iwjf3Pfpbwqq0EYUSJUqO pruL4vdHg4kj+rcR40e0I/mrrld/Taxx7NLI1wjQSrKIR9pq2TqQgeew5f3wSR1gsUmd HU94A/0VztjPZx+YcaoVU742IfBd9bUWYXYwiPIdKKuxJW7RxbQ4iG/OuE1QFf+T35pN SBlw== X-Gm-Message-State: APjAAAVoeF0tDhHh+jZ1zl01xHn4+cX7XfKl7UjCRKcOyZMjQtYcwkQS SI1/qug1Tl4E+AvxihHDCnfPNIb9 X-Google-Smtp-Source: APXvYqxhnD8PzrgYCW5JRRJNyAbiQ+WSD7ewKwKNtNW+xGLMReOG8DVIG2N2Sn0uFeAMOnvUoNY4+w== X-Received: by 2002:a05:6000:118d:: with SMTP id g13mr12824819wrx.141.1578590543924; Thu, 09 Jan 2020 09:22:23 -0800 (PST) Date: Thu, 9 Jan 2020 17:22:22 +0000 From: Stephane Chazelas To: zsh-users@zsh.org Subject: Re: Unreadable directories aren't included in glob expansion Message-ID: <20200109172222.uwgyjouab45zk2gf@chaz.gmail.com> Mail-Followup-To: zsh-users@zsh.org References: <20200109154145.rqksfenozx6745rn@tarpaulin.shahaf.local2> <1578585101.6028.13.camel__24021.2781982095$1578585228$gmane$org@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1578585101.6028.13.camel__24021.2781982095$1578585228$gmane$org@samsung.com> User-Agent: NeoMutt/20180716 [re-post to zsh-users. Sorry I read my MLs on gmane and always forget that zsh-users and zsh-workers are cross-posted] 2020-01-09 15:51:41 +0000, Peter Stephenson: > 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. [...] */ in all shells also includes symlinks to directories. So if only for that reason, it has to be different from *(/). Now, zsh seems to be the only shell where */ excludes the non-*searchable* (it does include the non-readable ones provided you have search access). It might make it the only POSIX compliant shell as I have a vague recollection it's meant to give the same result as */., but that could very well be a bad recollection, and if that was a POSIX requirement, that's probably one that should change. IMO, */ should give the same list as *(-/) (with some / appended), that is expand to the files that can be determined to be of type "directory" after symlink resolution (determined from the result of stat(), not lstat()) for consistency with other shells. -- Stephane