- Glob (programming)
In
computer programming , the verb glob or globbing is used to refer to an instance ofpattern matching behavior. The noun glob is sometimes used to refer to a particular pattern, e.g. "use the glob "*.log" to match all those log files".Many
command line interpreter s (shells) such asUnix shell s,cmd.exe andWindows PowerShell , provide globbing onfilename s at the command line and inshell script s. [The [http://www.faqs.org/docs/abs/HTML/globbingref.html "Advanced Bash-Scripting Guide, Chapter 19.2: Globbing"] (Mendel Cooper, 2003) has a concise set of examples of filename globbing patterns.]The term glob is also used to refer more generally to limited pattern matching facilities of this kind in other contexts:
*Larry Wall 's "Programming Perl " discusses "glob" in the context of thePerl language.
*Tcl contains both true regular expression matching facilities and a more limited kind of pattern matching often described as globbing.
* Python has a "glob" module in the standard library which performs wildcard pattern matching on filenames.
* Ruby has a "glob" method for the "Dir" class which performs wildcard patten matching on filenames. Several libraries such as Rant and Rake provide a FileList class which has a glob method or use the method FileList. [] identically.Etymology
glob() is a
Unix library function that expands file names using a pattern-matching notation reminiscent ofregular expression syntax but without the expressive power of true regular expressions.References
ee also
*
regular expression
*wildcard character
*wildmat
Wikimedia Foundation. 2010.