Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

glob

You are here: irt.org | FOLDOC | glob

<file system, programming> /glob/ A mechanism that returns a list of pathnames that match a pattern containing wild card characters. Globbing was available in early versions of Unix and, in more limited form, in Microsoft Windows.

The characters are:

* = zero or more characters, e.g. "probab*" would match probabilistic, probabilistically, probabilities, probability, probable, probably.

? = any single character, e.g. "b?g" would match bag, big, bog, bug.

[] any of the enclosed characters, e.g. "b[ao]g" would match bag, bog (not on Windows).

These have become sufficiently pervasive that hackers use them in written messages. E.g. "He said his name was [KC]arl" (expresses ambiguity). "I don't read talk.politics.*" (any of the talk.politics subgroups on Usenet). Other examples are given under the entry for X.

Later Unix shells introduced the x,y,z syntax which expands to a comma-separated list of alternatives, thus foobaz,qux would expand to "foobaz" and "fooqux". This differs from a glob because it generates a list of all possible expansions, rather than matching against existing files.

Glob patterns are similar, but not identical, to regular expressions.

"glob" was a subprogram that expanded wild cards in archaic pre-Bourne versions of the Unix shell. It is also a bulit-in function in Perl.

(2014-08-22)

Nearby terms: Glish « Glisp « glitch « glob » global index » globalisation » Global Network Navigator

FOLDOC, Topics, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, ?, ALL

©2018 Martin Webb