'\"macro stdmacro
.if n .pH g1M.getdev @(#)getdev	40.11 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} getdev 1M "Essential Utilities" "\&"
.if \nX=1 .ds x} getdev 1M "Essential Utilities"
.if \nX=2 .ds x} getdev 1M "" "\&"
.if \nX=3 .ds x} getdev "" "" "\&"
.TH \*(x}
.SH NAME
\f4getdev\f1 \- lists devices based on criteria
.SH SYNOPSIS
.ft CW
getdev \f1[\f4\-ae\f1]\f4 \f1[\f4\f2criteria\f4 \f1[\f4...\f1]\|]\f4 \f1[\f4\f2device\f4 \f1[\f4...\f1]\|]\f4
.SH DESCRIPTION
\f4getdev\f1
generates a list of devices that match certain criteria.
The criteria includes
a list of attributes (given in expressions) and a list of devices.
If no 
criteria is given, all
devices are included in the list. 
.P
Devices must satisfy at least one of the criteria in the list unless the 
\f4\-a\f1 option is used.
Then, only those devices which match all of the
criteria in a list will be included.
.P
Devices which are defined on the command line and which match the criteria are
included in the generated list.
However, if the \f4\-e\f1 flag is used, the
list becomes a set of devices to be \f2excluded\f1 from the list.
.SS Criteria Expression Types
There are four possible expression types which the criteria specified in the 
\f2criteria\f1 argument may follow:
.TP 18
\f2attribute\f4=\f2value\f1
Selects all devices whose attribute \f2attribute\f1 is defined and is equal to
\f2value\f1.
.TP 18
\f2attribute\f4!=\f2value\f1
Selects all devices whose attribute \f2attribute\f1 is defined and does not
equal \f2value\f1.
.TP 18
\f2attribute\f4:*\f1
Selects all devices which have the attribute \f2attribute\f1 defined.
.TP 18
\f2attribute\f4!:*\f1
Selects all devices which do 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 to 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 devices which follows on the command line should be
\f2excluded\f1 from the list generated by this command.
(Without the \f4\-e\f1
the named devices are \f2included\f1 in the generated list.)
The flag has no effect if no devices are defined.
.TP 18
\f2criteria\f1
Defines criteria that a device must match to be included in the generated list.
Should be given in expressions.
.TP 18
\f2device\f1
Defines devices which should be included in the generated list. 
Can be the pathname of the device or the device alias.
.bp
.SH ERRORS 
The command will exit with one of the following values:
.TP .25i
\f40\f1 =
Successful completion of the task.
.TP .25i
\f41\f1 =
Command syntax incorrect, invalid option used, or internal error occurred.
.TP .25i
\f42\f1 =
Device table could not be opened for reading.
.SH FILES
.ft CW
/etc/device.tab
.ft
.SH SEE ALSO
.na
\f4devattr\fP(1),
\f4getdgrp\fP(1),
\f4putdev\fP(1),
\f4putdgrp\fP(1),
\f4getdev\fP(3X).
.ad
