File: em-glob.el.html

The globbing code used by Eshell closely follows the syntax used by zsh. Basically, here is a summary of examples:

  echo a* ; anything starting with 'a'
  echo a#b ; zero or more 'a's, then 'b'
  echo a##b ; one or more 'a's, then 'b'
  echo a? ; a followed by any character
  echo a*~ab ; 'a', then anything, but not 'ab'
  echo c*~*~ ; all files beginning with 'c', except backups (*~)

Recursive globbing is also supported:

  echo **/*.c ; all '.c' files at or under current directory
  echo ***/*.c ; same as above, but traverse symbolic links

Using argument predication, the recursive globbing syntax is sufficient to replace the use of 'find <expr> | xargs <cmd>' in most cases. For example, to change the readership of all files belonging to 'johnw' in the '/tmp' directory or lower, use:

  chmod go-r /tmp/**/*(u'johnw')

The glob above matches all of the files beneath '/tmp' that are owned by the user 'johnw'. See [Value modifiers and predicates], for more information about argument predication.

Defined variables (9)

eshell-error-if-no-globIf non-nil, it is an error for a glob pattern not to match.
eshell-glob-case-insensitiveIf non-nil, glob pattern matching will ignore case.
eshell-glob-chars-listList of additional characters used in extended globbing.
eshell-glob-include-dot-dotIf non-nil, glob patterns that match dots will match . and ..
eshell-glob-include-dot-filesIf non-nil, glob patterns will match files beginning with a dot.
eshell-glob-load-hookA list of functions to run when ‘eshell-glob’ is loaded.
eshell-glob-show-progressIf non-nil, display progress messages during a recursive glob.
eshell-glob-splice-resultsIf non-nil, the results of glob patterns will be spliced in-place.
eshell-glob-translate-alistAn alist for translation of extended globbing characters.

Defined functions (16)

eshell--all-glob-chars-p(STRING)
eshell--contains-glob-char-p(STRING)
eshell--glob-char-p(STRING INDEX)
eshell-add-glob-modifier()
eshell-expand-glob(GLOB)
eshell-extended-glob(GLOB)
eshell-glob-chars-regexp()
eshell-glob-convert(GLOB)
eshell-glob-convert-1(GLOB &optional LAST)
eshell-glob-entries(PATH GLOBS ONLY-DIRS)
eshell-glob-initialize()
eshell-glob-p(PATTERN)
eshell-glob-regexp(PATTERN)
eshell-no-command-globbing(TERMS)
eshell-parse-glob-chars()
eshell-parse-glob-string(GLOB)

Defined faces (0)