"SCRUZIA" ... a very infrequently updated weblog ...

2008-10-29

zsh: missing end of name

I run zsh at work, and was puzzled by an error message I got today:
zsh: missing end of name
The command line was something like this:
echo J Random Guru (rg@example.com) is an email address.
A brief web search led to this old zsh source file, which helped to explain things a tiny bit. Based on it, I tried a slight modification:
echo J Random Guru (rg@example.com@) is an email address.
and got a much more satisfying error message:
zsh: unknown group
It turns out that zsh's parenthesis-based file filtering (called "Glob Qualifiers" in the man page) has some features I never new about. 99% of the time that I use it, it's for a command line something this:
ls -ld *(/)
which does a long ls of all of the directories (and not their contents) in $PWD. Next most common are *(^/) which is all non-directories, and *(*) (executable plain files), which I confuse with *(x) (owner-executable files). The reason that this is relevant to the puzzling error message is that two of the possibilities inside the parentheses are "u" for userid and "g" for group id. These take a numeric user or group id, or a matchable delimiter! So a slight modification of my pattern (*(rg@example.com@)) should match any files that are owner-readable (the "r"), and have group-ids matching the group named "example.com". Of which there are none. For reference:
$ echo $ZSH_VERSION
4.2.5
$

0 comments: