4.3BSD/usr/contrib/icon/man/man1/gset.1

.so tmac.ilib
.TH GSET 1 "The University of Arizona \- 8/16/84"
.SH NAME
gset \- perform set operations on UNIX file specifications
.SH SYNOPSIS
\*Mgset\fP argument
.SH DESCRIPTION
The UNIX shell provides for the specification of filenames using ``wildcards''.
Each wildcard specification may be thought of as defining a set of names
(that is, those that match the specification).
\fIGset\fR allows the user to apply the set operations of intersection,
union, and difference to these filename sets. The resultant list may then
be used as an argument to other shell commands.
.PP
\fIGset\fR's argument is an expression composed of legal UNIX
file specifications, parenthesis, and the following set operators:
.DS
.ta .5i
&&	\fRintersection\*M
++	\fRunion\*M
\-\-	\fRdifference\fR
.DE
Because characters that
have special meaning to the shell occur frequently in the arguments used
for \fIgset\fR, it is advisable to quote the arguments consistently.
.PP
The use of \fIgset\fR is illustrated by the following examples:
.DS
gset 'g*\-\-*.icn'
.DE
produces the list (set) of filenames for files beginning with \*Mg\fR,
excluding those ending with \*M.icn\fR.
.PP
Similarly,
.DS
gset '*'
.DE
produces all files in the current directory excluding the \*M.\fR and \*M..\fR files.
.DS
gset '((*\-\-*.icn)++c*)'
.DE
and
.DS
gset '(*\-\-*.icn)++c*'
.DE
produces the complement of all filenames ending with \*M.icn\fR in addition to
all filenames beginning with \*Mc\fR.
.DS
gset '(((c? && c*)))'
.DE
is a redundant, but legal, specification for all two-character filenames
that begin with \*Mc\fR, while
.DS
gset '.*'
.DE
produces the set of filenames for all hidden files, excluding the \*M.\fR and \*M..\fR
files.
.SH LIMITATIONS
Multiple command line arguments, formed by omitting the quotes around the
file set expression, are permitted.
Their use is limited, however, since parentheses do not get past
the shell's command-line expansion.
.PP
Almost any legal file specification will work when enclosed in quotes
except that the simple grammar that is used cannot handle blanks
adjacent to parentheses.
.PP
File names that begin or end in ``questionable'' characters
such as \*M*\fR, \*M?\fR, \*M+\fR, \*M\-\fR, and \*M&\fR, probably will not work.
.PP
A file specification that, when interpreted by the shell,
produces no matching filename will be placed (unchanged) in the result.
.SH SEE ALSO
gcomp(1),
fset(1)
.SH AUTHOR
Thomas R. Hicks