Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Glob (programming)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Origin== The glob command, short for ''global'', originates in the earliest versions of Bell Labs' [[Unix]].<ref name="man7Unix1"/> The command interpreters of the early versions of Unix (1st through 6th Editions, 1969β1975) relied on a separate program to expand [[wildcard character]]s in unquoted arguments to a command: ''/etc/glob''. That program performed the expansion and supplied the expanded list of file paths to the command for execution. Glob was originally written in the [[B (programming language)|B programming language]]. It was the first piece of mainline Unix software to be developed in a [[high-level programming language]].<ref name="reader">{{cite tech report |first1=M. D. |last1=McIlroy |author-link1=Doug McIlroy |year=1987 |url=http://www.cs.dartmouth.edu/~doug/reader.pdf |title=A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971β1986 |series=CSTR |number=139 |institution=Bell Labs}}</ref> Later, this functionality was provided as a C [[library function]], <code>glob()</code>, used by programs such as the [[Bourne shell|shell]]. It is usually defined based on a function named <code>fnmatch()</code>, which tests for whether a string matches a given pattern - the program using this function can then iterate through a series of strings (usually filenames) to determine which ones match. Both functions are a part of [[POSIX]]: the functions defined in POSIX.1 since 2001, and the syntax defined in POSIX.2.<ref name=fnmatch3>{{man|3|fnmatch|Linux}}</ref><ref>{{man|3|glob|Linux}}</ref> The idea of defining a separate match function started with [[wildmat]] (wildcard match), a simple library to match strings against Bourne Shell globs. Traditionally, globs do not match hidden files in the form of Unix [[dotfiles]]; to match them the pattern must explicitly start with <code>.</code>. For example, <code>*</code> matches all visible files while <code>.*</code> matches all hidden files.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)