'\" te .\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 1989 AT&T .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH GETDGRP 8 "August 13, 2023" .SH NAME getdgrp \- lists device groups which contain devices that match criteria .SH SYNOPSIS .nf \fB/usr/bin/getdgrp\fR [\fB-ael\fR] [\fIcriteria\fR]... [\fIdgroup\fR]... .fi .SH DESCRIPTION \fBgetdgrp\fR generates a list of device groups that contain devices matching the given criteria. The criteria is given in the form of expressions. .SH OPTIONS The following options are supported: .sp .ne 2 .na \fB\fB-a\fR\fR .ad .RS 6n Specifies that a device must match all criteria to be included in the list generated by this command. The option has no effect if no criteria are defined. .RE .sp .ne 2 .na \fB\fB-e\fR\fR .ad .RS 6n Specifies that the list of device groups on the command line should be \fIexcluded\fR from the list generated by this command. Without the \fB-e\fR option the named device groups are \fIincluded\fR in the generated list. The flag has no effect if no devices are defined. .RE .sp .ne 2 .na \fB\fB-l\fR\fR .ad .RS 6n Specifies that all device groups (subject to the \fB-e\fR option and the \fIdgroup\fR list) should be listed even if they contain no valid device members. This option has no affect if \fIcriteria\fR is specified on the command line. .RE .SH OPERANDS The following operands are supported: .sp .ne 2 .na \fB\fIcriteria\fR\fR .ad .RS 12n Defines criteria that a device must match before a device group to which it belongs can be included in the generated list. Specify \fIcriteria\fR as an expression or a list of expressions which a device must meet for its group to be included in the list generated by \fBgetdgrp\fR. If no criteria are given, all device groups are included in the list. .sp Devices must satisfy at least one of the criteria in the list. However, the \fB-a\fR option 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. .sp There are four possible expressions types which the criteria specified in the \fIcriteria\fR argument may follow: .sp .ne 2 .na \fB\fIattribute\fR\fB=\fR\fIvalue\fR\fR .ad .RS 20n Selects all device groups with a member whose attribute \fIattribute\fR is defined and is equal to \fIvalue\fR. .RE .sp .ne 2 .na \fB\fIattribute\fR\fB!=\fR\fIvalue\fR\fR .ad .RS 20n Selects all device groups with a member whose attribute \fIattribute\fR is defined and does not equal \fIvalue\fR. .RE .sp .ne 2 .na \fB\fIattribute\fR\fB:*\fR\fR .ad .RS 20n Selects all device groups with a member which has the attribute \fIattribute\fR defined. .RE .sp .ne 2 .na \fB\fIattribute\fR\fB!:*\fR\fR .ad .RS 20n Selects all device groups with a member which does not have the attribute \fIattribute\fR defined. .RE See \fBputdev\fR(8) for a complete listing and description of available attributes. .RE .sp .ne 2 .na \fB\fIdgroup\fR\fR .ad .RS 12n Defines a set of device groups which should be included in or excluded from the generated list. Device groups that are defined and which contain devices matching the criteria are included. .sp If the \fB-e\fR option is used, this list defines a set of device groups to be excluded. When the \fB-e\fR option is used and \fIcriteria\fR is also defined, the generated list will include device groups containing devices which match the criteria and are not in the command line list. .RE .SH EXIT STATUS The following exit values are returned: .sp .ne 2 .na \fB\fB0\fR\fR .ad .RS 5n Successful completion of the task. .RE .sp .ne 2 .na \fB\fB1\fR\fR .ad .RS 5n Command syntax was incorrect, invalid option was used, or an internal error occurred. .RE .sp .ne 2 .na \fB\fB2\fR\fR .ad .RS 5n Device table or device group table could not be opened for reading. .RE .SH FILES .ne 2 .na \fB\fB/etc/device.tab\fR\fR .ad .RS 19n .RE .sp .ne 2 .na \fB\fB/etc/dgroup.tab\fR\fR .ad .RS 19n .RE .SH SEE ALSO .BR attributes (7), .BR devattr (8), .BR getdev (8), .BR putdev (8), .BR putdgrp (8)