glob

glob EXPR
globThis function returns the value of
EXPR with filename expansions the way a shell
would expand them. This is the internal function implementing the
<*> operator.
For historical reasons, the algorithm matches the
csh(1)’s style of expansion, not the Bourne
shell’s. Files whose first character is a dot (“.”) are ignored unless this character is
explicitly matched first. An asterisk (“*”) matches any sequence of any character
(including none). A question mark (“?”) matches any one character. A square
bracket sequence (“[…]”) specifies a simple character class, like
“[chy0–9]”. Character classes may be
negated with a circumflex, as in “*.[^oa]”, which matches any file with an
extension consisting of a period followed by one character that is
neither an “a” nor an “o”. A tilde (“~”) expands to a home directory, as in
“~/.*rc” for all the current user’s
“rc” files, or “~jane/Mail/*” for all
of Jane’s mail files. Braces may be used for alternation, as in
“~/.{mail,ex,csh,twm,}rc” to get
those particular rc files.
The glob function grandfathers the use of whitespace to separate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access