Expansion and Globbing


  • if a pattern or glob is badly formed, print out an error


  • See:
zsh% setopt no_brace_ccl
zsh% print {abc.}file
zsh% setopt brace_ccl
zsh% print {abc.}file
.file afile bfile cfile


  • the mighty =command expansion; try: print =emacs (if you've emacs installed)


  • of course, you want zsh's extended globbing features… Set this one, Luke!
  • "thou shalt always setopt extendedglob, and ye shall be saved much misery" (teratorn in #zsh, ca. 2007)


  • don't require a leading dot for matching "hidden" files


  • foo="*"; print $foo will print all files


  • be case sensitive when globbing


  • is a glob does not return matches, remove the glob from the argumentlist instead of reporting an error

failed pattern matches

There are several options that affect zsh's behavior when a pattern doesn't produce any filenames. They are summarized in this table, taken from From Bash to Z Shell, p. 212.

% ls
file1.h file1.c
option echo file1.* file2.* echo file2.*
default error error
no_nomatch file1.c file1.h file2.* file2.*
csh_null_glob file1.c file1.h error
null_glob file1.c file1.h empty argument list


options/expn.txt · Last modified: 2015/03/24 17:16 by remove-spam-mckael