|
|
1.1 ! root 1: .so tmac.ilib ! 2: .TH GSET 1 "The University of Arizona \- 8/16/84" ! 3: .SH NAME ! 4: gset \- perform set operations on UNIX file specifications ! 5: .SH SYNOPSIS ! 6: \*Mgset\fP argument ! 7: .SH DESCRIPTION ! 8: The UNIX shell provides for the specification of filenames using ``wildcards''. ! 9: Each wildcard specification may be thought of as defining a set of names ! 10: (that is, those that match the specification). ! 11: \fIGset\fR allows the user to apply the set operations of intersection, ! 12: union, and difference to these filename sets. The resultant list may then ! 13: be used as an argument to other shell commands. ! 14: .PP ! 15: \fIGset\fR's argument is an expression composed of legal UNIX ! 16: file specifications, parenthesis, and the following set operators: ! 17: .DS ! 18: .ta .5i ! 19: && \fRintersection\*M ! 20: ++ \fRunion\*M ! 21: \-\- \fRdifference\fR ! 22: .DE ! 23: Because characters that ! 24: have special meaning to the shell occur frequently in the arguments used ! 25: for \fIgset\fR, it is advisable to quote the arguments consistently. ! 26: .PP ! 27: The use of \fIgset\fR is illustrated by the following examples: ! 28: .DS ! 29: gset 'g*\-\-*.icn' ! 30: .DE ! 31: produces the list (set) of filenames for files beginning with \*Mg\fR, ! 32: excluding those ending with \*M.icn\fR. ! 33: .PP ! 34: Similarly, ! 35: .DS ! 36: gset '*' ! 37: .DE ! 38: produces all files in the current directory excluding the \*M.\fR and \*M..\fR files. ! 39: .DS ! 40: gset '((*\-\-*.icn)++c*)' ! 41: .DE ! 42: and ! 43: .DS ! 44: gset '(*\-\-*.icn)++c*' ! 45: .DE ! 46: produces the complement of all filenames ending with \*M.icn\fR in addition to ! 47: all filenames beginning with \*Mc\fR. ! 48: .DS ! 49: gset '(((c? && c*)))' ! 50: .DE ! 51: is a redundant, but legal, specification for all two-character filenames ! 52: that begin with \*Mc\fR, while ! 53: .DS ! 54: gset '.*' ! 55: .DE ! 56: produces the set of filenames for all hidden files, excluding the \*M.\fR and \*M..\fR ! 57: files. ! 58: .SH LIMITATIONS ! 59: Multiple command line arguments, formed by omitting the quotes around the ! 60: file set expression, are permitted. ! 61: Their use is limited, however, since parentheses do not get past ! 62: the shell's command-line expansion. ! 63: .PP ! 64: Almost any legal file specification will work when enclosed in quotes ! 65: except that the simple grammar that is used cannot handle blanks ! 66: adjacent to parentheses. ! 67: .PP ! 68: File names that begin or end in ``questionable'' characters ! 69: such as \*M*\fR, \*M?\fR, \*M+\fR, \*M\-\fR, and \*M&\fR, probably will not work. ! 70: .PP ! 71: A file specification that, when interpreted by the shell, ! 72: produces no matching filename will be placed (unchanged) in the result. ! 73: .SH SEE ALSO ! 74: gcomp(1), ! 75: fset(1) ! 76: .SH AUTHOR ! 77: Thomas R. Hicks
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.