'\"macro stdmacro
.if n .pH g1M.getdgrp @(#)getdgrp	40.12 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} getdgrp 1M "Essential Utilities" "\&"
.if \nX=1 .ds x} getdgrp 1M "Essential Utilities"
.if \nX=2 .ds x} getdgrp 1M "" "\&"
.if \nX=3 .ds x} getdgrp "" "" "\&"
.TH \*(x}
.SH NAME
\f4getdgrp\f1 \- lists device groups which contain devices that match criteria
.SH SYNOPSIS
.ft CW
getdgrp \f1[\f4\-ael\f1]\f4 \f1[\f4\f2criteria\f4 \f1[\f4...\f1]\|]\f4 \f1[\f4\f2dgroup\f4 \f1[\f4...\f1]\|]\f4
.SH DESCRIPTION
\f4getdgrp\f1
generates a list of device groups that contain devices matching 
the given criteria.
The criteria
is given in the form of expressions.
.P
\f2criteria\f1 can be one expression or a list of expressions which a device
must meet for its group to be included in the list 
generated by \f4getdgrp\f1.
If no
criteria is given, all device groups are included in the list.
.P
Devices must satisfy at least one of the criteria in the list.
However, 
the \f4\-a\f1 flag can be used to define that a "logical and" operation 
should be performed.
Then, only those groups containing devices
which match all of the criteria
in a list will be included.
.P
\f2dgroup\f1 defines a set of device groups to be included in the list.
Device groups that are defined and which contain devices matching 
the criteria are included.
However, if the \f4\-e\f1 flag is used, this list
defines a set of device groups to be excluded.
When the \f4\-e\f1 option is used and criteria is also defined, the generated
list will include device groups containing devices 
which match the criteria and are not in the command line list.
.SS Criteria Expression Types
There are four possible expressions types:
.TP 18
\f2attribute\f4=\f2value\f1
Selects all device groups with a member
whose attribute \f2attribute\f1 is defined and is equal to \f2value\f1.
.TP 18
\f2attribute\f4!=\f2value\f1
Selects all device groups with a member
whose attribute \f2attribute\f1 is defined and does not equal \f2value\f1.
.TP 18
\f2attribute\f4:*\f1
Selects all device groups with a member which has the 
attribute \f2attribute\f1 defined.
.TP 18
\f2attribute\f4!:*\f1
Selects all device groups with a member 
which does not have the attribute \f2attribute\f1 defined.
.sp
See the \f4putdev\fP(1M) manual page for a complete listing and description of
available attributes.
.SS Options and Arguments
The options and arguments for this command are:
.TP 18
\f4\-a\f1
Specifies that a device must match all criteria before a device group
to which it belongs can be included in the list
generated by this command.
The flag has no effect if no criteria are defined.
.TP 18
\f4\-e\f1
Specifies that the list of device groups
on the command line should be
\f2excluded\f1 from the list generated by this command.
(Without the \f4\-e\f1
the named device groups are the only ones which can be \f2included\f1 in 
the generated list.)
The flag has no effect if no device groups are defined.
.TP 18
\f4\-l\f1
Specifies that all device groups (subject to the \f4\-e\f1 option and the
\f2dgroup\f1 list) should be listed even if they contain no valid
device members.
This option has no affect if \f2criteria\f1 is specified on the command line.
.TP 18
\f2criteria\f1
Defines criteria that a device
must match before a device group to which it belongs can be 
included in the generated list.
.TP 18
\f2dgroup\f1
Defines device groups
which should be included in or excluded from the generated list. 
.SH ERRORS
The command will exit with one of the following values:
.TP 4
\f40\f1 =
successful completion of the task.
.TP 4
\f41\f1 =
command syntax incorrect, invalid option used, or internal error occurred.
.TP 4
\f42\f1 =
device table or device group table could not be opened for reading.
.SH FILES
.ft CW
/etc/device.tab
.br
/etc/dgroup.tab
.ft
.SH SEE ALSO
.na
\f4devattr\fP(1),
\f4getdev\fP(1),
\f4putdev\fP(1),
\f4putdgrp\fP(1),
\f4getdgrp\fP(3X).
.ad
