Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
glob executable vs. non executable
- X-seq: zsh-users 28279
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: glob executable vs. non executable
- Date: Thu, 27 Oct 2022 08:41:25 -0700
- Archived-at: <https://zsh.org/users/28279>
- List-id: <zsh-users.zsh.org>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author