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-glob | If non-nil, it is an error for a glob pattern not to match. |
eshell-glob-case-insensitive | If non-nil, glob pattern matching will ignore case. |
eshell-glob-chars-list | List of additional characters used in extended globbing. |
eshell-glob-include-dot-dot | If non-nil, glob patterns that match dots will match . and .. |
eshell-glob-include-dot-files | If non-nil, glob patterns will match files beginning with a dot. |
eshell-glob-load-hook | A list of functions to run when ‘eshell-glob’ is loaded. |
eshell-glob-show-progress | If non-nil, display progress messages during a recursive glob. |
eshell-glob-splice-results | If non-nil, the results of glob patterns will be spliced in-place. |
eshell-glob-translate-alist | An alist for translation of extended globbing characters. |
Defined functions (11)
eshell-add-glob-modifier | () |
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 | () |