From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10858 invoked from network); 9 Nov 2021 03:31:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Nov 2021 03:31:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1636428685; b=nGSykUS2HHce351uqcwGHdiEWdUKyIbnbW9dv7FoUo0hdUcVF8lMs7HAq05FU6SQd4Ci+yhr/M RwDKE6sujHgxwa+TqWRh1FJQdJZmd2rewmoNDVyDKK9eugtT9lqWwpXDhz8nfSu/y6lURTIG1q FQ2dJA1sbbRytPjr4c9GUKyOw4toxmi4Zlhxe/at5KsfK9xqj6CYoaPut6vROjwLmF2h0XA6WO VJ+HloTPDO0t2bdz39KOwdSFkK8QbhXiPjLr/GuqP3dmFMzk6NFZo2hj1X3s+TkNk/suVrz6Um 65j8p+CzeJ/w7oliNECdefJNv1mCosX+6LeKH6mK4tv//Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f174.google.com) smtp.remote-ip=209.85.219.174; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1636428685; bh=qWuyqiE/Fs39IRLsMqZuZqlQ+5E1FB6tTHHgOPy/wm0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=c3mm+9ThWNJCYPZqZznK0IJnplZuzn4Yml9FDHKvJR1rBk/PjVEUtDFETPvaHGR9z+GZrIzXg+ IIwqJLOPInk8GlfmeMcgcnpIGFaom8poTy++uA3G5h8VMLFCJdZoQUJclM9KVBwUx3vS4uI0sQ PPYXtu003nDzOkg9DiKm9IHzLjA+RByJrw+csA8MNP+90F7QcetF+NgB3S8IVU6b5GLLzl0B6f BZD22VE4fP/SvFiW492ltcJAeDWIGdCQXc1m2troxLdXFGDxMHRE+lulchskxaoRxZkhchMzYn NqKkEh5GjxXEyiiCpdtyR8XKiiDDNdRvnHjLzzEBnAcaLw==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=nHeod2H8aVyVflaPqCABu4J941FSgBirr6f3gaQ0yxc=; b=itQP7FnlBAYz7WB0GAt4mgPCe4 fMHQ/YRcBySJ+kDpWhTEmGakDVT535NAziXMHa4syLbCZebeh3xHLd978vRjD2X4AupoA6p7YAmQ1 NAf7pLq9WPgQG2CopKYQtDOjNFX+SQiuj0rts08rkd23nwGpKFNf50fnrnleRPbQZvAxSROkKnBKX 8q/Qx5DbG63NHN6tbFkyqrc+R73/szwjCtWwSn4/IspqhdqaPptfHfswfTqZijRo2Czkxm3nq+yYQ yWqauyRryexaqrx4S/GTBf/NLwoXrioAfqQ0DE9LZDqMcxJZLug8NwsABOcx6SJRjF7ciY1pIAq14 8X768qjw==; Received: from authenticated user by zero.zsh.org with local id 1mkHr3-0005CU-Ge; Tue, 09 Nov 2021 03:31:25 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f174.google.com) smtp.remote-ip=209.85.219.174; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yb1-f174.google.com ([209.85.219.174]:38499) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mkHqL-0004Wh-C3; Tue, 09 Nov 2021 03:30:42 +0000 Received: by mail-yb1-f174.google.com with SMTP id v64so49295537ybi.5 for ; Mon, 08 Nov 2021 19:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nHeod2H8aVyVflaPqCABu4J941FSgBirr6f3gaQ0yxc=; b=sfGZ2fxt7OWgNcFG4najqSyvUsRvGQZ7VISIJqIXpxJNGw7/BC9o3bAFAvaGIFQIOw g0dw/xu7Xm1s+Th8asONHlqZTf2Q7oh0MEPYCFfYpct8NU61P+79S5HLHyA7hd68attn yf9sWKx7iZHZLm1Zc4VLlqsjMqFdb1OtWaOy31cwEXgBj4rS8JY1+hIDqypSbnAkQrRJ TqrG++XU8OciZlQg79VxAmfIudlI3MM6oWd806RAJXjOynF+yJ3Mu6n616sfgR4GCl6x Xyfx4z1hmLGqKjbM/3yajIqttAKEXyxAsd2Mtozh/IQ3JWjXK5FPQEh5dSy9Ks/9+440 59iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nHeod2H8aVyVflaPqCABu4J941FSgBirr6f3gaQ0yxc=; b=GZ9EjVKze+KAh73C1EA2tEV0PO8aHYOEu4nXIc/VqQxnR595B1kIOsIgzRqcYzHRjb pLlsaJdsuThc3OTNaZXMKIiMRG8mx3on26DtoyZc7hRycPjGicKsB0Xh4G9uyghwf7jD xjIC6Quv3rBw4qT/le+5YL+abd9pgxKD/bq7vR2b5l00FWflzLFrOaHO3L70Ou2I8qjC DiNqLc8sfGFXjzm3NHRiaTvTOPxN5QUiTxDcN71vvhAq2oqf4C+plKkfMCQ7OAOZNIu+ sEYdEC1Hkwi0hTzDvhhr9PImMwOzXdsGxjWeTkqn6LMaDym0HrQIHVBqLjYAENDQfM75 5qFQ== X-Gm-Message-State: AOAM5317w0GqwMe4kv05ITjpFEabDdc/ZVoOPZx4G0mZZ95dDUqafZx7 xm5r1Ast4PV9DfbZ14aFOqK1j5+sDv01PrJBLv14PLKMhW7gJA== X-Google-Smtp-Source: ABdhPJxwbcU4obv3oFUwb2+Xi5P4ktQUODHmGnV725MqmYIARC4BUkixltuUikBQneDGgaLU7tWHVttBFlJebVQKtqU= X-Received: by 2002:a25:1102:: with SMTP id 2mr4940191ybr.266.1636428640298; Mon, 08 Nov 2021 19:30:40 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Mon, 8 Nov 2021 19:30:29 -0800 Message-ID: Subject: Re: Compound Glob Specifiers To: Zach Riggle Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27334 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: On Mon, Nov 8, 2021 at 3:03 PM Zach Riggle wrote: > > It would then follow that *(/)/*(/)/somefile would match dir/dir/somefile and not dir/link/somefile. Lawrence also said this, but since I've already typed it ... Parenthesized qualifiers can't appear in the middle of a glob. The stat() etc. calls that implement the qualifiers are only applied after the full path name is generated. Manual in section 14.8.7 says -- Patterns used for filename generation may end in a list of qualifiers That means the whole pattern, not individual path segments. The only things you can put elsewhere are the flags listed in 14.8.4. > I want to glob the equivalent of */*/somefile (not **/foo, specifically two directories deep). If your tree is not excessively deep, you can do it like this (assumes extendedglob) % ls **/somefile~*/*/*/* This says "find all somefile below here, without following symlinks, and then throw away any names that contain three slashes" (which includes any that have more than three). For a tree deep enough to cause **/ to be slow, you have to get fancier (and this doesn't require extendedglob): % ls */*/somefile(e^'[[ $REPLY:a = $REPLY:P ]]'^) The fun thing about that last one is that if you replace "=" with "!=" you can find all the paths that DO have symbolic links.