From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id E775722E16 for ; Sun, 21 Jan 2024 19:03:53 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1705860233; b=Wt3BmI/eYojNMaIxLQN1fwbjHmUoMW1qDho4mwwjEXBXMkeYpeipAGNBJOVhNVGF4WsWyOcWAU jRKmN5fqVFyceddyXp2TIcaDov+fLh7DHtW5in06tCUa4OVGZBvnNHsB/Qw/bce171Rz3oQVt0 0OM91bU5ynI/KmwPDKLfGzt1k6/d+zsdxq/8MtzXqJqBXGXNus6YllEq9xpb7aczLNFa0fN4zi 9lD2l1RXalNbh4iCwbxsi5Y9liU/XmKTPjxKXx40ZPVmVRo5pR2MCm6CX/PFO82rxYliY1dQXq lzgHHtEuwCjtJ8EGFojDlSuqRMR1tQsXvVHYENOHjKhkWg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f182.google.com) smtp.remote-ip=209.85.208.182; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1705860233; bh=Afs+mRLvd8ZQGb0puPySzjIOKxvcSkt35/4Kv0JGQ4Y=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=eGN6nKHfrXtF0+i0oN1Su1eX5RNnqtB20URIeVDcyhUTiKK01XyJOFcVEb7XqW0z0c+pM6Xcbr gRGJezJFBdoRaB1A79x5bbpH9Q2IKK/VmHAo98pqbM8IqwRGH27H474RUydOytO8nRko2Spsmv 1H7VA5lPCTJ9fgaMNHXp/Y25cYWXDFp8NOmwBrrZFoAcgi0yMOp86YErpsOCxjCc5aieW6Wula LtAQg0hBKg/JJD/GlA0ExssCcvBeEsoVYm1S5SKrjlrA4i/bXZFPOfU+uAW8SJ/W0XnuRsL/Lo GAM9jIo9qeMUuWFMUVs18opECKq21Lr7M6uYk0Qc7S8jnA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=l1aX1CEyBlDv+vJJpiNEwevMboyA94NV3h6MX0aTCL8=; b=jP5WDb6sihG6mmdNfk+qNIGM4z E4f4faT3BGWTJZHNo1Xkj2kgNveIe/CwqAKHJ5VMrhGTipvoZm2rOrHoi07c30JXkjEZO16EiAaWg 0NdLMDyK5G8y+pO0BDEpiIudCHscf2Oz2H35xRZ6zlImXtEvScV9NkG+HNmYKE3gOYx1HMwBYol6y 6DoFurRvB4BwlUJzzbaTjim/II1Ij6xqsQJkO0X8vfIxRtdUJWXne9yeXIviHubNhgG84CKz95YLu 0qoVU7bAmsDRNIqh0TGGqwPj78eJnyyqmqRsDFzTs60C/A4rh7IUsgQ5z7yZGLN58KLXb7zQbCDRj E2/Po3EA==; Received: by zero.zsh.org with local id 1rRcAj-000L49-LS; Sun, 21 Jan 2024 18:03:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f182.google.com) smtp.remote-ip=209.85.208.182; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f182.google.com ([209.85.208.182]:59671) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rRc9h-000KL5-1n; Sun, 21 Jan 2024 18:02:49 +0000 Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2cdf69bb732so23980471fa.3 for ; Sun, 21 Jan 2024 10:02:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705860168; x=1706464968; darn=zsh.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=l1aX1CEyBlDv+vJJpiNEwevMboyA94NV3h6MX0aTCL8=; b=HOyQqTm4syXrPncJ9/DOAnDf9oA7zAnXiP9yZQ3HXZJykokdS1AA/+9uXtu4wedDrk 8ySXCPkG7e5Ue29wX42RTX+3L7I4pvve4WshOGhQEQAhz+YAzwUQQI71aP7425995HBm jkQOsawjgDLeq7wZzATks/XIoNNg6ftD8f+QFrA1mj5b/Ubdwcl3PDE611Zn+VKv1XIW 7yC14QGGd016J+hrau36Fhm04K+WTSmYKsqj9+b0aVwRt70AIz94s9J/928vs4OSIh5G 9LMgohFrinjEKMXSmBGppL0QVIsmXwaHLRonKu1/XEPaUHiwaKEma6CQxqc1+j6WkE6N qmkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705860168; x=1706464968; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l1aX1CEyBlDv+vJJpiNEwevMboyA94NV3h6MX0aTCL8=; b=wtmF1aBd/VE6ZKjwOPuZ7+qv1nRHdly7vz4KXpZLk50btPS6/nEnEpHte50/Me+rzY gsDUrAP8sLNy6MvdJQCFR/mZpxZNqNrSJWU1JVFjBGFZSOKffYdap2/i3/MVuWVgJ3ui 4x88OlflFhMEwV63+dCulJCGBYgycpmdC8W3NdXyyupFX9EpvYV6wPQvJ14fRqPWq0ug vAqvXpiD7TxWW2Nujs0fvx3aYJp0HsZltntf5BNtWH1tgO1AFIbPdGRvnaJnoUEXx+0c 7KalC1E5SU5hBvoTwJRsDHdntrIIue8Jm9rRdolWT5PSSQRB9sqc3emrFM5ORBO5ZreW OqXA== X-Gm-Message-State: AOJu0YzlcK2nnw35ydnzEPTSVG09iFmfGUbNji6DFIKFH+sPL0VvDr5u TCuMDv/rd4H81Av2uHk7JDR6cd1kCaTuGGnA7O2qq0Zw8misAjjbPqewD2HV3m81Okp+xauRD1j X2MJOaeGbegy+EWedekS4cCPokL8btmIg X-Google-Smtp-Source: AGHT+IEPiIO4bea/oA3kvbYTbPGvF19Y+fY8s30ImK+AQaWIalDg+Rd88gj9G40EdT3drjdvy2sd/YlaJtxV4DnBBKw= X-Received: by 2002:a2e:a713:0:b0:2cc:6ab1:e6a4 with SMTP id s19-20020a2ea713000000b002cc6ab1e6a4mr399142lje.71.1705860167516; Sun, 21 Jan 2024 10:02:47 -0800 (PST) MIME-Version: 1.0 References: <62da1cec-bcc9-49ed-8f5f-ad428fdd3f20@eastlink.ca> In-Reply-To: From: "Mark J. Reed" Date: Sun, 21 Jan 2024 13:02:35 -0500 Message-ID: Subject: Re: /proc slows % echo /**/*/etc/r*(/N) To: Zsh Users Content-Type: multipart/alternative; boundary="000000000000524757060f788507" X-Seq: 29532 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000524757060f788507 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Gah, extraneous punctuation marks. To reiterate, this pattern: /^proc will match everything in the root directory except /proc. And this one: /**/etc will match a directory named "etc" no matter how deep in the file system it is, such as /foo/bar/baz/zoo/wicky/etc. Zsh basically has to enumerate every file on your disk drive to figure out what matches that. On Sun, Jan 21, 2024 at 1:00=E2=80=AFPM Mark J. Reed = wrote: > /^proc. will match everything except /proc, so you can easily look for > files like /^proc/**/whatever. > > But on my system which has no /proc, `**` is just as much a culprit, sinc= e > that does a recursive search throughout the entire file system. For > instance, /**/etc matches /`foo/bar/baz/zoo/wicky/etc` and so on... > > On Sun, Jan 21, 2024 at 12:20=E2=80=AFPM Ray Andrews > 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: >> >> /proc/9/root/etc/rc0.d /proc/9/root/etc/rc1.d /proc/9/root/etc/rc2.d >> /proc/9/root/etc/rc3.d /proc/9/root/etc/rc4.d /proc/9/root/etc/rc5.d >> /proc/9/root/etc/rc6.d /proc/9/root/etc/rcS.d /proc/9/root/etc/rsyslog.d >> /proc/9/task/9/cwd/etc/rc0.d /proc/9/task/9/cwd/etc/rc1.d >> /proc/9/task/9/cwd/etc/rc2.d /proc/9/task/9/cwd/etc/rc3.d >> /proc/9/task/9/cwd/etc/rc4.d /proc/9/task/9/cwd/etc/rc5.d >> /proc/9/task/9/cwd/etc/rc6.d /proc/9/task/9/cwd/etc/rcS.d >> /proc/9/task/9/cwd/etc/rsyslog.d /proc/9/task/9/root/etc/rc0.d >> /proc/9/task/9/root/etc/rc1.d /proc/9/task/9/root/etc/rc2.d >> /proc/9/task/9/root/etc/rc3.d /proc/9/task/9/root/etc/rc4.d >> /proc/9/task/9/root/etc/rc5.d /proc/9/task/9/root/etc/rc6.d >> /proc/9/task/9/root/etc/rcS.d /proc/9/task/9/root/etc/rsyslog.d >> >> ... I'm wondering why /proc wasn't a problem previously and if there's >> anything I can do to filter it out of the search -- probably all the >> Linux 'system' directories too. I recall that there's some test, >> something in permissions, some flag -- that identifies these >> not-quite-real directories -- zsh knows who they are. They're really in >> RAM, yes? I know the tilde is used to make exceptions: >> >> for bb in *.eml~save*; do >> >> ... all files matching '*.eml' excepting those that match 'save*' ... >> but I can't get the syntax correct with the above. >> >> % echo /**/*/etc/r*~/proc*(/N) >> >> % echo /**/*/etc/r*(/N)~/proc* >> >> ... were busts. But the right answer is to filter out all those virtual >> directories. Don't know why this didn't used to be a problem. But I >> think I did deal with this issue a few years ago, too. >> >> >> >> >> > > -- > Mark J. Reed > --=20 Mark J. Reed --000000000000524757060f788507 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Gah, extraneous punctuation marks.=C2=A0 To reiterate, thi= s pattern:

=C2=A0 =C2=A0 /^proc

will match everything in the root directory except /proc. And this one:

=C2=A0 =C2=A0 /**/etc

will= =C2=A0match a directory named "etc" no matter how deep in the fil= e system it is, such as /foo/bar/baz/zoo/wicky/etc.=C2=A0 Zsh basically has= to enumerate every file on your disk drive to figure out what matches that= .

On Sun, Jan 21, 2024 at 1:00=E2=80=AFPM Mark J. Reed <markjreed@gmail.com> wrote:
/^proc. wil= l match everything except /proc, so you can easily look for files like /^pr= oc/**/whatever.=C2=A0

But on my system which has no = /proc, `**` is just as much a culprit, since that does a recursive search t= hroughout the entire file system. For instance, /**/etc matches /`foo/bar/b= az/zoo/wicky/etc` and so on...

On Sun, Jan 21, 2024 at 12:20=E2=80=AFP= M Ray Andrews <rayandrews@eastlink.ca> wrote:
I used to do this kind of thing without any proble= ms:

=C2=A0=C2=A0=C2=A0=C2=A0 % echo /**/*/etc/r*(/N)

... but just trying it, zsh labors for close to an hour, then spits out countless pages of:

/proc/9/root/etc/rc0.d /proc/9/root/etc/rc1.d /proc/9/root/etc/rc2.d
/proc/9/root/etc/rc3.d /proc/9/root/etc/rc4.d /proc/9/root/etc/rc5.d
/proc/9/root/etc/rc6.d /proc/9/root/etc/rcS.d /proc/9/root/etc/rsyslog.d /proc/9/task/9/cwd/etc/rc0.d /proc/9/task/9/cwd/etc/rc1.d
/proc/9/task/9/cwd/etc/rc2.d /proc/9/task/9/cwd/etc/rc3.d
/proc/9/task/9/cwd/etc/rc4.d /proc/9/task/9/cwd/etc/rc5.d
/proc/9/task/9/cwd/etc/rc6.d /proc/9/task/9/cwd/etc/rcS.d
/proc/9/task/9/cwd/etc/rsyslog.d /proc/9/task/9/root/etc/rc0.d
/proc/9/task/9/root/etc/rc1.d /proc/9/task/9/root/etc/rc2.d
/proc/9/task/9/root/etc/rc3.d /proc/9/task/9/root/etc/rc4.d
/proc/9/task/9/root/etc/rc5.d /proc/9/task/9/root/etc/rc6.d
/proc/9/task/9/root/etc/rcS.d /proc/9/task/9/root/etc/rsyslog.d

... I'm wondering why /proc wasn't a problem previously and if ther= e's
anything I can do to filter it out of the search -- probably all the
Linux 'system' directories too.=C2=A0 I recall that there's som= e test,
something in permissions, some flag -- that identifies these
not-quite-real directories -- zsh knows who they are.=C2=A0 They're rea= lly in
RAM, yes?=C2=A0 I know the tilde is used to make exceptions:

=C2=A0=C2=A0=C2=A0=C2=A0 for bb in *.eml~save*; do

... all files matching '*.eml' excepting those that match 'save= *' ...
but I can't get the syntax correct with the above.

=C2=A0=C2=A0=C2=A0=C2=A0 % echo /**/*/etc/r*~/proc*(/N)

=C2=A0=C2=A0=C2=A0=C2=A0 % echo /**/*/etc/r*(/N)~/proc*

... were busts.=C2=A0 But the right answer is to filter out all those virtu= al
directories.=C2=A0 Don't know why this didn't used to be a problem.= =C2=A0 But I
think I did deal with this issue a few years ago, too.






--
Ma= rk J. Reed <mar= kjreed@gmail.com>


--
Ma= rk J. Reed <mar= kjreed@gmail.com>
--000000000000524757060f788507--