Zsh: select files with arbitrary code in (e) or + glob qualifiers 0 ▲ Adam Johnson 121 days ago · Tech · hide · Fediverse post Zsh glob qualifiers can select files by many built-in attributes: type, size, modification time, and more. But when no built-in qualifier fits, you can bring in the e or + qualifiers to run arbitrary code, making globs a fully programmable file filter. With great power comes great responsibility! The e syntax looks like this: extend your glob, like *, with (e:'CODE':), replacing CODE with your Zsh code to run. : is an arbitrary delimiter, and the quoting is needed to stop Zsh from expanding variables and interpreting special characters before the glob runs. Zsh runs the code once per matched file, with the file name in the $REPLY variable, and keeps the file if the code exits successfully (status 0). The + syntax is simpler, as it takes just a command name to run, which is most usefully a Zsh function, as seen below. Using e to check for .git I’ll show you with an example. Say I have a bunch of my open source repositories in a directory, along with some other stuff: $ print -l *… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town