zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: Zsh Users <zsh-users@zsh.org>
Subject: glob executable vs. non executable
Date: Thu, 27 Oct 2022 08:41:25 -0700	[thread overview]
Message-ID: <22b55ee0-ab85-1352-87a7-32dde5c7678d@eastlink.ca> (raw)

I'm trying to break all 'real' files -- ignoring those weird 'special' 
files that linux makes -- into two groups: executables, which I take to 
be x-scripts, binaries and symlinks, vs. everything else, basically 
unx-scripts and plain text files.

$  eval "all_unx=( (#i)$1(N.^*) )"
... that seems to work for the later, the dot excludes symlinks but 
includes executables so: '^*' excludes those.  But what's the converse?  
I'm wanting:

$   eval "all_x=( (#i)$1(N*@) )"

... but it's a bad pattern. I can append two searches, one for '*' the 
other for '@' but I'm betting there's a clean way of doing it.  
Basically real files that whence is interested in vs. real files she is 
not interested in.  Given that these glob qualifiers have a quite 
astonishing power, it seems puzzling that ... well, I shouldn't presume 
it isn't already there, but in my mind:

$   eval "all_matches=( (#i)$1(NX )"

... anything whence finds, anything executable that is a file. Oh, and 
while I'm imagining new glob qualifiers, how about 'T': any text file, 
(un)executable script or just a cookie recipe but made of readable text.




             reply	other threads:[~2022-10-27 15:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 15:41 Ray Andrews [this message]
2022-10-27 20:02 ` Lawrence Velázquez
2022-10-27 21:44   ` Ray Andrews
2022-10-27 23:19     ` Lawrence Velázquez
2022-10-27 23:39       ` 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=22b55ee0-ab85-1352-87a7-32dde5c7678d@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).