GLOB [>outfile] [option]* :command
(+|-)Catalogs (+|-)Files -Match +Privileged -Stop concatenationCharacter= Tablesize=nn (500)
glob :wc /ab[0-9].? glob c= :echo jpblotney/source/*.g glob +c >*cats :cmdlib/* glob c=; :rele /source/*
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.