zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: /proc slows % echo /**/*/etc/r*(/N)
Date: Sun, 21 Jan 2024 11:58:57 -0800	[thread overview]
Message-ID: <a80a4cb0-4baa-458f-8b6f-dbb98dad00fa@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7ZQioZ5BgYMYzsp+8aqB2iq4Tm3Fm_WHMpGYPVbn+u8bg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]


On 2024-01-21 11:09, Bart Schaefer wrote:
>> Why /**/*/ rather than just /**/ ?  The extra /*/ there will expand
>> symbolic links, which are normally skipped by /**/.

I just now realized that.

>> ... so by expanding that you're traversing the
>> whole filesystem again, which takes you back to /proc/ again, and so
>> on for every PID until zsh gives up (probably because it can't
>> allocate any more memory).

It had that looping feeling.  Didn't realize that it was crashing tho, I 
thought it was actually finishing.

> I suspect previously you weren't adding that extra /*/.  What do you
> mean for that to accomplish?

      % echo /**/*/etc/r*(/N) #BAD
      % echo /**/*etc/r*(/N)  #GOOD

... at some point the '/' got added, don't know. I just missed it.
All good.  Man, what a strange adventure tho.

> There's no glob qualifier for that, if that's what you mean.  As it
happens, those directories always appear to be empty, so you can find
them with /*(/L0)

Ok I'll look at that.  Mind, the above has solved the problem.  Still one might save a millisecond avoiding searches of those virtual directories -- or not.

> 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)

Hangs. Never mind!



[-- Attachment #2: Type: text/html, Size: 2292 bytes --]

  reply	other threads:[~2024-01-21 19:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-21 17:19 Ray Andrews
2024-01-21 18:00 ` Mark J. Reed
2024-01-21 18:02   ` Mark J. Reed
2024-01-21 18:08     ` Ray Andrews
2024-01-21 20:09       ` Juergen Christoffel
2024-01-21 20:59         ` Ray Andrews
2024-01-21 19:09 ` Bart Schaefer
2024-01-21 19:58   ` Ray Andrews [this message]
2024-01-21 21:48     ` Bart Schaefer
2024-01-22  0:07       ` Ray Andrews
2024-01-22  1:02         ` Bart Schaefer
2024-01-22  1:54           ` Ray Andrews
2024-01-22  6:00   ` Mikael Magnusson
2024-01-22 15:06     ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a80a4cb0-4baa-458f-8b6f-dbb98dad00fa@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).