From mboxrd@z Thu Jan 1 00:00:00 1970 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=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 6280 invoked from network); 12 Apr 2020 12:49:36 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with UTF8ESMTPZ; 12 Apr 2020 12:49:36 -0000 Received: (qmail 4551 invoked by alias); 12 Apr 2020 12:49:26 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45681 Received: (qmail 9530 invoked by uid 1010); 12 Apr 2020 12:49:26 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-5.server.virginmedia.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25772. spamassassin: 3.4.4. Clear:RC:0(80.0.253.69):SA:0(-2.0/5.0):. Processed in 3.8731 secs); 12 Apr 2020 12:49:26 -0000 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _smtprelay.virginmedia.com designates 80.0.253.69 as permitted sender) X-Originating-IP: [86.16.88.158] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.3 cv=Mu58FVSe c=1 sm=1 tr=0 a=MiHCjVqLJ44lE3bxSlffFQ==:117 a=MiHCjVqLJ44lE3bxSlffFQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=9oLFVwE53CSqxBuyZXwA:9 a=QEXdDO2ut3YA:10 a=udgzWJOYkD3Pfp8pHeEA:9 a=ZQP7uAOFQ64A:10 a=dmeShB4hkOsA:10 Message-ID: Subject: Re: glob qualifier '-' doesn't work correctly on dangling symlinks From: Peter Stephenson To: zsh-workers@zsh.org Date: Sun, 12 Apr 2020 13:48:43 +0100 In-Reply-To: <20200411173450.56nnznxtmil5oge3@chazelas.org> References: <20200411151511.GA1708902@zira.vinc17.org> <20200411173450.56nnznxtmil5oge3@chazelas.org> Content-Type: multipart/mixed; boundary="=-M/itlVkRiom9DiVoC56O" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 X-CMAE-Envelope: MS4wfC8TjK3g/1f7pszCTTDW50FgW+HOGKiAlYu75zh2L9NCb5Rgu2KUaZT6pqgP9uuJjngasjqKyJYANeV3lXSo1GC4Z3B6+uAsnBIavar1oBVhcv8E2wIf F/ljMFz7ao1AHpY6QdLXWbwzvriyxZtPcfNJySECxONjxO+XZ1lnYYsU --=-M/itlVkRiom9DiVoC56O Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On Sat, 2020-04-11 at 18:34 +0100, Stephane Chazelas wrote: > 2020-04-11 17:15:11 +0200, Vincent Lefevre: > [...] > > +zsh:10> ls -l file3 > > lrwxrwxrwx 1 lefevre lefevre 5 2008-12-28 22:34:28 file3 -> file0 > > > > file*(-W) should have no matches. > > [...] > > It is not really documented but kind of implied that on broken > symlinks, after -, we're still looking at the symlink instead of > the target (there's no target for us to look at anyway). > > The manual has: > > > ls -ld -- *(-@) > > > > lists all broken symbolic links, and Yes, it's already implicit and useful that this is how it works; I use it myself. We should document it better. The current form is ambiguous --- "the file it refers to" is meaningless if it doesn't refer to a file. We certainly can't change this at this stage, but that wouldn't stop us adding something with alternative behaviour. For convenience, the proposed wording in the attached is item(tt(-))( toggles between making the qualifiers work on symbolic links (the default) and the files they point to, if any; a broken symbolic link is treated as a file in its own right ) pws --=-M/itlVkRiom9DiVoC56O Content-Disposition: attachment; filename="broken_symlinks.dif" Content-Type: text/x-patch; name="broken_symlinks.dif"; charset="UTF-8" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL0RvYy9ac2gvZXhwbi55byBiL0RvYy9ac2gvZXhwbi55bwppbmRleCAyYTY2 YWI5OTcuLmZkMWYxY2EzYiAxMDA2NDQKLS0tIGEvRG9jL1pzaC9leHBuLnlvCisrKyBiL0RvYy9a c2gvZXhwbi55bwpAQCAtMjgzNyw3ICsyODM3LDggQEAgbmVnYXRlcyBhbGwgcXVhbGlmaWVycyBm b2xsb3dpbmcgaXQKICkKIGl0ZW0odHQoLSkpKAogdG9nZ2xlcyBiZXR3ZWVuIG1ha2luZyB0aGUg cXVhbGlmaWVycyB3b3JrIG9uIHN5bWJvbGljIGxpbmtzICh0aGUKLWRlZmF1bHQpIGFuZCB0aGUg ZmlsZXMgdGhleSBwb2ludCB0bworZGVmYXVsdCkgYW5kIHRoZSBmaWxlcyB0aGV5IHBvaW50IHRv LCBpZiBhbnk7IGEgYnJva2VuIHN5bWJvbGljIGxpbmsKK2lzIHRyZWF0ZWQgYXMgYSBmaWxlIGlu IGl0cyBvd24gcmlnaHQKICkKIGl0ZW0odHQoTSkpKAogc2V0cyB0aGUgdHQoTUFSS19ESVJTKSBv cHRpb24gZm9yIHRoZSBjdXJyZW50IHBhdHRlcm4K --=-M/itlVkRiom9DiVoC56O--