Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
*/file glob and directory symlinks
- X-seq: zsh-workers 44465
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: */file glob and directory symlinks
- Date: Fri, 28 Jun 2019 10:24:13 +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:mime-version :content-disposition:user-agent; bh=rfP5576nfnllGNSWnJRu3N6F363HaSvJ1tcA/PClmjc=; b=IkbxLiUsTm7plf83xPMlOupWH9gsuJ7FqkT/C164fKPCLd1BpueGdk1AU6j2moU5KR 7xYZ58e2SBeXs6/UhF1tAWJiSPYWzN9Ue7xjqPN0r5QAQ91AqpRTj/B8Sp6wAhA5lDV1 8GWgcVftaDt7i16RLBhe/VGq7mRwq4GNunkUyPb1C72sTPSgo1M7ERHWX5pRw3Se6p5d tpbJxSmVlv7L718/YOY61FCo/NZCJmwNip7hJBV/NjpjqQAP4IjmiLIu+m0cZa9834/4 EgMwwxKcG6r6mYOibOmSb//FXVDbcjxU0KxHucnsnpAF3+RG+a63pfNQOdpHGc7UdtrA o8NA==
- 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: Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hiya,
it's something that's been bothering me for a while:
$ mkdir dir
$ ln -s dir link
$ touch file dir/file
$ echo **/file
file dir/file
"link" is not followed, which is what I expect (same for
(*/)#file or (*/)##file). If I want the link to be followed, I
can use
$ echo ***/file
file dir/file link/file
Fine (though there's no link-following equivalent for (^CVS/)#
for instance)
Now in
$ echo */file
dir/file link/file
symlinks are always followed and there's no way to disable it,
other than doing things like
$ echo **/file~*/*/*
dir/file
which finds every file at any depth and then excludes the ones
at depth other 2 so is not really usable in practice.
These don't work:
$ echo (*/)file
zsh: bad pattern: (*/)file
$ echo (*/)(#c1)file
zsh: bad pattern: (*/)(#c1)file
Maybe we could have a glob qualifier that prevents following
symlinks, or support (*/) as the non-following variant of */
even when it's not followed by "#" or "##", or have per-path
component glob qualifiers like *(#q^@)/file (which could have
other uses like (*(#q^u:0:)/)#file to skip looking into dirs
owned by root)?
What do you think?
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author