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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11518 invoked from network); 8 Nov 2021 23:04:40 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Nov 2021 23:04:40 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1636412680; b=fO4l+rQ70EQJvOfF9fHSR12wHFBxY4wEvtsXP3UOyDOHLRB3pXtCZQlxi53SIKRp2k/9sXP6dc s+eBH9z1MGPbCfsal9z4Qgpfe4HchEAFiov4XbhY6EoR07np8pz3Jx6D3pbzn1KjR7gY++fe0o UxVamPeWESvMXzeYPloBK/LRKKdQXkaHceeBLXMIhmHwhiYbCVxy1YZPx4ltFJBG/7tSUHGtht mLpkdW8bu0+KLKPvxN2WRa0paQbU1lyOXVkME+KyLZbU0x0uMKzYEnVGj3G9hh0GYiJLgsUHcZ /qF0cAVB4ZVd5juVlifi6zFrKMKDD4706rexgK2rbPYkZw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f41.google.com) smtp.remote-ip=209.85.128.41; dkim=pass header.d=gmail.com header.s=20210112 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=1636412680; bh=hqEa+/nhq8+pdQ5CND48f/AFcHifuicjvd9yDcZnM0g=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=XCM8dblg+rgmmIfnyh4YtW7GkJ1dUZq1185PPwQcBU8CBfWdoDAJNALJcWpkacWlfvuUHOpIjK YvCVrbG5R/k9+GScABLJ9gYn42/QvjtaOgRGw7FOO6tGe1rStQcL+/+nycL/sL5K+ILPGoYC52 Zt9LIMswQwzoKTeY8Fyr5EAAaS9+nkJ2hBqH34vo5GG0k2fB93Tjrz461RWF+ESftQ5yyX1XLM 7w1TwYg7J365u6J7cvvtnumPCrn0J40Ru6odYao2aDgpbw/xPOb5cfxtP2Tzo6jVceq4n51klT 62e6JlYsyvOydUywvQKyJbNzAzcmzeg4ytsrbJE19H7gtA==; 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: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:In-Reply-To:References; bh=hqEa+/nhq8+pdQ5CND48f/AFcHifuicjvd9yDcZnM0g=; b=nDKy1Og64kJPF8hsbQCVCMibps tNfDWYbP05J9XFDbmv/rKfRYfGV92lXOGdiBWCSjQLy83B1MjyVKFSi4J0qglhEuB8pu7MR8sLU/3 UdZHspjyK+dE73ysJxE1gtsTzeRf6Pg84Z9rc6D5DHh5VxB1acPLa7TCXV85qVxN9WDWWts7acvns L3GT+xRR8G/Crw5hQeTKrRqcg7tr/ZlO3EFO+++gTw1RU0gW/3pJntvmFlFZxcj5pcYtm/u3hZ1jy 0GgS1dOhgsdoaNVZXRKYb9xx1uvcB2z9XSgYtzKAlr4eV+2XM5kIFWpr1GcXSIoDxP9fM84dkacWH eFDrg/WQ==; Received: from authenticated user by zero.zsh.org with local id 1mkDgt-000LBq-So; Mon, 08 Nov 2021 23:04:39 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f41.google.com) smtp.remote-ip=209.85.128.41; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wm1-f41.google.com ([209.85.128.41]:35392) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mkDg4-000KQt-CM; Mon, 08 Nov 2021 23:03:48 +0000 Received: by mail-wm1-f41.google.com with SMTP id 77-20020a1c0450000000b0033123de3425so484653wme.0 for ; Mon, 08 Nov 2021 15:03:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=hqEa+/nhq8+pdQ5CND48f/AFcHifuicjvd9yDcZnM0g=; b=MnPFTCWW/oxp1pI7rOqg20zjLUIclklyiYQtHorefw2DtlCXhUJctnb1mT7+i7aUwF f5Cr1L0CbMW2TiQ/XIbIstyKsRzJ4N9GAwrqJ4rdM2Q919gq5Te3wJkwjxYJDhx23Wun Sd2aWxNS9dJAANgQZHXEeuIfpUBE/T4uqlpmkGjPDqtu5WqVY4O454GBTfAS9qXgm/sA dOAZjgkUdB/Yi5GU4KeUjnT5cbO9UMWaKOZFrspwyAK4blThesGaC0kqYrqeW4XTwjCl QlL3tJRj3/hJ06CxNsn7hgQsSoV/c5bDaejQnoeE9I6Ta36q68FpA4f0LsnC2LJdhusT ilWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hqEa+/nhq8+pdQ5CND48f/AFcHifuicjvd9yDcZnM0g=; b=RHzQAWcTRa1loCNsCkUm32AbttGNl5bmdC9fwcBhzQ3W2gOOnnKoXcUbZz+CxesvFh CJG1h0RhLIjW2YHVgwTLYIHfvHoXybVV2GU5OkYX7I3CmBv/OzKUJOq/mIVAYHjSh1Ko wEp2Ep7Jip6br911DxmnTSnxp8hzuSsINJoEQKliHF2x0leCK4Ox/+5bSwtTm+TzsmbY knieqtjxIzuqAKrguYBFkocA9ygVG2mwoYAW2edOJDD4IAfi6SfMaKapNNJKs3nTbVxw HxjEOqiyO/VPxJJyEQBBi5+/8kyPCHNekhKOz9Z4M1NAXLbyaJ+OMRFv1MnTWaNGIXXS HhVg== X-Gm-Message-State: AOAM532KMN6/MCFtOgezmPz0ihgLR7kT6k+BoVlXtcn9En6LYNrEkcF9 1NW1q1qpbDjlORAGaTlskuAZcPvKYP6st/ZtxQ1aNPswr8HsBQ== X-Google-Smtp-Source: ABdhPJxc3zm3GmXdmiw2Yya03ZjWVlSmoeN6SiaqDGulrVXdzq/4d7QQvvxAYdxMLwesjZi4IPgUznrN+LBoXl921TU= X-Received: by 2002:a1c:7201:: with SMTP id n1mr2038963wmc.176.1636412627592; Mon, 08 Nov 2021 15:03:47 -0800 (PST) MIME-Version: 1.0 From: Zach Riggle Date: Mon, 8 Nov 2021 17:03:36 -0600 Message-ID: Subject: Compound Glob Specifiers To: Zsh Users Content-Type: multipart/alternative; boundary="0000000000005fad0605d04f0112" X-Seq: 27331 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: --0000000000005fad0605d04f0112 Content-Type: text/plain; charset="UTF-8" I expect this is a case of "you're holding it wrong", but I figure it's worth asking what the right way to do this is... I want to glob the equivalent of */*/somefile (not **/foo, specifically two directories deep). However, I do NOT want the glob to match if any of the directory components are a symlink. *(/) is the glob specifier for directories [1] It would then follow that *(/)/*(/)/somefile would match dir/dir/somefile and not dir/link/somefile. This is not the case -- even *(/)/ (i.e. appending a trailing slash to all directories) do not work out-of-the-box as one might expect. I've read through 14.8 Filename Generation [2] as best I can (my favorite hack being the NTREF=reffile bit) but haven't found anything that suggests how one might do this. [1] https://zsh.sourceforge.io/Doc/Release/Expansion.html#index-BARE_005fGLOB_005fQUAL_002c-use-of [2] https://zsh.sourceforge.io/Doc/Release/Expansion.html#Filename-Generation *Zach Riggle* --0000000000005fad0605d04f0112 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I expect this is a case of "you're holding it wro= ng", but I figure it's worth asking what the right way to do this = is...

I want to glob the equivalent of */*/somefile (not= **/foo, specifically two directories deep).

Howev= er, I do NOT want the glob to match if any of the directory components are = a symlink.

*(/) is the glob specifier for director= ies [1]

It would then follow that *(/)/*(/)/somefi= le would match dir/dir/somefile and not dir/link/somefile.

This is not the case -- even *(/)/ (i.e. appending a trailing slas= h to all directories) do not work out-of-the-box as one might expect.=C2=A0= =C2=A0

I've read through 14.8 Filename Generat= ion [2] as best I can (my favorite hack being the NTREF=3Dreffile bit) but = haven't found anything that suggests how one might do this.
<= br>
--0000000000005fad0605d04f0112--