GLOB - globally execute command, given pathname patterns.

Syntax:

GLOB  [>outfile]  [option]*  :command
(+|-)Catalogs
(+|-)Files
    -Match
    +Privileged
    -Stop
concatenationCharacter=
Tablesize=nn (500)

Examples:

glob :wc /ab[0-9].?
glob c= :echo jpblotney/source/*.g
glob +c >*cats :cmdlib/*
glob c=; :rele /source/*

Options:

(+|-)Catalogs, (+|-)Files
These options control whether files, catalogs, or both are to be considered by GLOB. Turning one option on (+) or off (-) implicitly turns the other off or on. The default is "+Files", i.e. work only with the files matching the given pattern.
concatenationCharacter=x
Normally, GLOB issues one command line for each pathname matched, but specifying this option will cause GLOB to put all matched pathnames on a single command line. The given character "x" is used to concatenate the pathnames. Using "C=" without a following character will cause the concatenation character to be a space. Generated lines longer than 240 characters will cause an error. This may be avoided by using separate GLOBs with ranges [a-e], [f-j], etc.
-Match
causes GLOB to work with all pathnames which do NOT match the given pattern.
+Privileged
allows the possessor of a LODS privilege bit to call GLOB on any catalog.
-Stop
tells GLOB to continue execution even if an error occurs (normally GLOB quits). Hitting "break" while a breakable subsystem is executing (e.g. L or P) is considered to be an error.
Tablesize=nn
specifies a size for GLOB's internal table of pathnames. The default is 500, which is more than adequate for most jobs. GLOB issues an error message if the list of pathnames is too big to fit in its table.

Description:

GLOB executes the given command using some or all of the first-level entries beneath a given catalog which match the given pattern(s). GLOB normally issues the given command once for each entry that matched, but will attempt to put all pathnames on a single command line if the "C=" option is used.

GLOB will match a pathname pattern constructed with the following special symbols.

"*" - to match sequence of zero or more characters
"?" - to match any single character
"[class]" - to match any of the characters
            contained in the string "class".

For example, "/*.b" will match all files ending with ".b", including a file called "/.b". The pattern "/part[1-4]" would match the files "/part1", "/part2", "/part3", and "/part4". (Inside the "[]", one may use the syntax "a-z" to match the characters from "a" to "z" inclusive. Of course this works for characters other than "a" and "z" too.) This description takes the form of a standard pathname, with the pattern forming the lowest level. (See the examples above.) It should be noted that trying to use more than one pattern or placing the pattern at other than the lowest level will result in failure. The following descriptions, for example, are invalid.

jpblotney/catalog/*.t/file1
/catalog/*/*

The description up to the part containing the pattern is separated and assumed to be the name of a catalog. Each entry under this catalog is compared with the remaining pattern. If a match occurs, the full pathname of that entry is constructed and saved.

When all the entries of a given catalog have been examined, those pathnames which were matched are then sorted alphabetically. From this sorted list of pathnames, GLOB attempts to generate and execute a series of command lines consisting of the given command and its arguments. This is done using the matched pathnames instead of the GLOB pattern argument.

Copyright © 1996, Thinkage Ltd.