Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: /proc slows % echo /**/*/etc/r*(/N)
- X-seq: zsh-users 29542
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: /proc slows % echo /**/*/etc/r*(/N)
- Date: Mon, 22 Jan 2024 07:00:59 +0100
- Archived-at: <https://zsh.org/users/29542>
- In-reply-to: <CAH+w=7ZQioZ5BgYMYzsp+8aqB2iq4Tm3Fm_WHMpGYPVbn+u8bg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <62da1cec-bcc9-49ed-8f5f-ad428fdd3f20@eastlink.ca> <CAH+w=7ZQioZ5BgYMYzsp+8aqB2iq4Tm3Fm_WHMpGYPVbn+u8bg@mail.gmail.com>
On 1/21/24, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sun, Jan 21, 2024 at 9:19 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>>
>> I used to do this kind of thing without any problems:
>>
>> % echo /**/*/etc/r*(/N)
>>
>> ... but just trying it, zsh labors for close to an hour, then spits out
>> countless pages of:
>
> Without trying it, which I'm not going to do, I think the answer to
> your specific question might be:
>
> echo /**/^(proc|sys)/etc/r*(N)
>
> But that might actually miss /etc/r* because it would be looking for
> /etc/etc/. There's no syntax for excluding things specifically from
> the ** pattern.
You actually can, **/ is shorthand for (*/)# although the latter only
works with extended_glob enabled, the shorthand always works. You can
use any pattern in place of the * if you want (for example,
(^(a|b|c)/)# which would exclude a, b or c from any segment being
recursed), although in the case above I think you'd have actually
wanted /^(proc|sys)/**/etc/r* if the problem was not another typo.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author