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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 404 invoked from network); 18 Aug 2021 03:28:07 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Aug 2021 03:28:07 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1629257287; b=XoCHVdxpvzxg9u7eui+JrSKQGLj1oPx5PFF1mV1I3OwfHHV9OV4ytEPhLpaDfnE8yqlOpNP5eH pGZbP+gI7YU2d+nqrA16cHvEJz6RPpRA+DpvCRE0CjjLws3s9rF3gYc9Y6sOgfbMOFlNiyYy3X IR7kfR9xFpxhejBnO1e0gkAnYk6xvKT53ybz+1F2X/XWKq/U+u71pEMPbFYTtQRu4hHhLWNQI7 K3rMCxdKWDlbIIF2lvhWnwkTRvIFeTVMRQVYfOBcNbmmMGxizqm5WBqJhVZoNhjAZUa5SR/qOG QEr8BVjmTrDE+nrOqAetHF/33q+XYFR/8dAw7DTXa7/Uyw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wr1-f52.google.com) smtp.remote-ip=209.85.221.52; dkim=pass header.d=gmail.com header.s=20161025 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=1629257287; bh=tw3PMKQ+5o0nJ5cTHsu6Xj8XFL4cMEgh/PRezqW4vyM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:DKIM-Signature:DKIM-Signature; b=iH9TgyJIqcC6MnVYN11k5qL/+AIF0mQlcZlJvIoPZMDpvUNbseCunONpLRRZbifpeKnU+2xV9m Xa1Fp7TqmuvbukzPXvIg6OJUBGOCJwGKwq1C1PcImGUqS7cH8XDbxfH1/KTMPaLgzAQG1VrrQg HKP7Dt2c6LpqH2ablXV7tahIYKycHAjaHUU7I67glP3mbOO0PXp67XgQgNMgpAfeiHR1eolV5j 0U4lxp+v6dIBI64jM6wvmWoNdMmLaOsFqrv+zT7IlXMxtM1Od1qodxTTPp/3D954uUknvmrVOV hWOh43WCcnCh5so9LDIyK2R2FLSkKLhShhbI5mOlivG73A==; 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-Transfer-Encoding: Content-Type:To:Subject:Message-ID:Date:From:MIME-Version:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=0LlhIXGtmOkSHTOZ4784FkIjxUiCagDgRm3Os9FGK6Q=; b=lRsXGb18v1Gk0VXI4Qy6cCO+vn 11EgB6fCKGZ3WAvT8VZQj9a1ZpVzrR47/FWDcF/1uz2z/Fdzrv54HCVqeLaKCSQejdeZjLIcDM+VR T+RK6UcVAJeecQ5eTVup4Ik/sW1p9mJuxlvSF0X060RARIRWiFOtjNw/UKvnIKhbKJNLj+be6XGy8 j56Zk8I5bcBkcwWHmhpqpc79kiZR2/xBJO4iHJG5I17YvWtCfy5sE41S+2+K2I82JFIPM6GMO9OGK Fif0Y8+UeuGuboYvlIbyF19kiKuRiBOMlNrZ/im2cTJ6UHe/r/8BLg0gRKm9VuH6wKDMbw03vTIHE nofKsmKA==; Received: from authenticated user by zero.zsh.org with local id 1mGCFK-000Pdy-Nm; Wed, 18 Aug 2021 03:28:06 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wr1-f52.google.com) smtp.remote-ip=209.85.221.52; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wr1-f52.google.com ([209.85.221.52]:39499) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mGCEl-000Ouz-DW; Wed, 18 Aug 2021 03:27:31 +0000 Received: by mail-wr1-f52.google.com with SMTP id q6so1157522wrv.6 for ; Tue, 17 Aug 2021 20:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=0LlhIXGtmOkSHTOZ4784FkIjxUiCagDgRm3Os9FGK6Q=; b=kAbFeh2OeD/vtr69sVIZ5jKKuW3Rr1RuJjYF+H7sMxlp//1VR3Udgpkm489VRCGu5B PFlHNwaDw0+DFc+gwZkWjIn8FxVt48U31UhofSxiuNvMMH115dboGjixtP7d0uDw7+Ka Ky3mOiId/PNuCZWiYbf/Lgx6ourH+dNn6oaXyU9O8r+qEm98+PSelQOthsQVS1nsPK59 uEaRanXSlS0EdV2xQQ6Rn0DylQTzWv/XzDmdrB5/6S43r2UgEETYGeb3P2WBFmXV7gUl jsEkMSx9ixYVfDABsteMA6m6cGrAcYGvs+0B2+pTnHytdozfN9cAAkytFDZ8yB7Grnd3 EpKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=0LlhIXGtmOkSHTOZ4784FkIjxUiCagDgRm3Os9FGK6Q=; b=TRv9XhvEZ51uYxaBpKtiyxXLrWllvaFuo3D0qw6dcvErGxXJ+jVwVeNitWzJeSUyxK 1E8TVhOa9DkorRGM+mAuy9VTZc04w/+drQwg1OHvE2H7mOVsyZF9r02ON2gyj9uydHOF KnDLwNHa2RXz3Shza7YOMoe4zSy8VZ794S6OPz5WqsGWshIIk9hDiwHLU8aMxL0qy6Zv fY3+HbKNY7v7/LVyuZ8KXrYvFaspnUstMFp82vDL+LkFpkmCVUHIwFd7+8uatkk4qba8 tkAQbVlHceQO3c7jNxEiFwPlMLCZS2lNg4S8Ij4s+6/z5VE0Le3/0Xe7/l8j6QB2xgJB P5oA== X-Gm-Message-State: AOAM532/K+mbKHpjJAq3UDyKllVTx+x2J0enUvpRHZJ6zf21lKYPQIKa 2fJZQS+U9AkkdH8gu8zu0rjLcRmYwIzwMrgLYsi5jLCmn/s= X-Google-Smtp-Source: ABdhPJwH6Fq42MjLwG80SCvTxRPUFM44thf7hL9USB0uX612ON1vnKKK3PWzqmQmbJuuV+x1W4SP2EFRuqxyaSHdN9M= X-Received: by 2002:a5d:4442:: with SMTP id x2mr7677258wrr.60.1629257250649; Tue, 17 Aug 2021 20:27:30 -0700 (PDT) MIME-Version: 1.0 From: Zach Riggle Date: Tue, 17 Aug 2021 22:27:19 -0500 Message-ID: Subject: Globbing symlinks-to-${glob_qualifier} To: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 26947 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: Hello guys! ---- UPDATE: Managed to figure it out on my own (see update at the end), but thought this was still worth posting in case the mail archives get indexed by Google. ---- After the (surprising!) success of my earlier message, I figured this was worth asking. My question is whether there's a way to combine the @ with any of the other glob qualifiers -- i.e. to glob for symlinks-to-directories or symlinks-to-executables. Many of the glob qualifiers are specific, simple, and well-documented -- *(*) for executables, *(/) for directories, *(.) for files, and *(@) for symlinks. I tried the obvious combinations, but these didn't work. Not surprising. $ ls -lad *(/) # Shows all directories $ ls -lad *(@/) # Error $ ls -lad *(/@) # Error I also managed to find the bit on the ":" qualifier, after which everything is treated as a modifier (e.g. "ls -d *(@:A)" passes the full path of each symlink to "ls"). This should probably be featured more prominently in the documentation, like the other qualifiers. I looked at "14.8.7 Glob Qualifiers" and the third paragraph is a bit hard for me to grok**. For context, I do have the 'extendedglob' option set. > If the option EXTENDED_GLOB is set, a different syntax for glob qualifier= s is available, namely =E2=80=98(#qx)=E2=80=99 where x is any of the same g= lob qualifiers used in the other format. I was able to chain things together and get the glob operation to succeed, but couldn't produce anything of use. This works to show all things that are (1) files and (2) executable files -- but not any better than (*) by itself. $ ls -lad *(#q*.) Trying multiple specifiers for symlink-and-directory does not work. $ ls -lad *(#q@/) ... No such file or directory Further down, after the documentation, there is discussion of the "-" qualifier, which can be used (per the example): > ls -ld -- *(-/) > lists all directories and symbolic links that point to directories This is ALMOST what I want -- but I just want the "symbolic links that point to directories" part. **UPDATE**: A bit more fiddling around, by combining (#qx) and (-/) and I ended up with this, which does exactly what I want! $ ls -la *(#q-/)(@) Hurray! It also works-as-expected with this form for files: $ ls -la *(#q-.)(@) Ultimately, I managed to sort it out and everything works how I want! Zach Riggle