Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Some problems with recursive globbing
- X-seq: zsh-users 20187
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Some problems with recursive globbing
- Date: Thu, 07 May 2015 16:52:50 +0100
- In-reply-to: <CABZhJg-f_PDTtaJf8Fg6qVZQ2wLmAXG-tLXLub7Sq=GW9vXwDA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CABZhJg-f_PDTtaJf8Fg6qVZQ2wLmAXG-tLXLub7Sq=GW9vXwDA@mail.gmail.com>
On Thu, 7 May 2015 16:35:57 +0200
Jesper Nygårds <jesper.nygards@xxxxxxxxx> wrote:
> Question: I found it surprisingly difficult to to find a glob pattern that
> excluded target directories and their contents at all levels. Have I
> complicated this too much, is there an easier way to express this glob?
Yes, you can use '(^target/)#'.
Note also that after "~" is just a pure pattern --- / isn't special.
So if you had to exclude explicitly as /target/ or target/ or /target
you'd use ~(|*/)target(|*/)
> Problem: I can't get this to work for both cases of a) directories with
> spaces in their names and b) directories with parenthesis in their names
Native zsh options are *supposed* to be set up to be insensitive to this
sort of nonsense...
Try putting
emulate -L zsh
as the first line of your function. I may have missed something more
subtle.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author