Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / comm.1
blobfdaf5f6db6ab40a92c63dedb6f1bb0994504c561
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
45 .\" Copyright (c) 2004, Sun Microsystems, Inc.  All Rights Reserved.
46 .\"
47 .TH COMM 1 "Mar 3, 2004"
48 .SH NAME
49 comm \- select or reject lines common to two files
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fBcomm\fR [\fB-123\fR] \fIfile1\fR \fIfile2\fR
54 .fi
56 .SH DESCRIPTION
57 .sp
58 .LP
59 The \fBcomm\fR utility reads \fIfile1\fR and \fIfile2\fR, which must be ordered
60 in the current collating sequence, and produces three text columns as output:
61 lines only in \fIfile1\fR; lines only in \fIfile2\fR; and lines in both files.
62 .sp
63 .LP
64 If the input files were ordered according to the collating sequence of the
65 current locale, the lines written will be in the collating sequence of the
66 original lines. If not, the results are unspecified.
67 .SH OPTIONS
68 .sp
69 .LP
70 The following options are supported:
71 .sp
72 .ne 2
73 .na
74 \fB\fB-1\fR\fR
75 .ad
76 .RS 6n
77 Suppresses the output column of lines unique to \fIfile1\fR.
78 .RE
80 .sp
81 .ne 2
82 .na
83 \fB\fB-2\fR\fR
84 .ad
85 .RS 6n
86 Suppresses the output column of lines unique to \fIfile2\fR.
87 .RE
89 .sp
90 .ne 2
91 .na
92 \fB\fB-3\fR\fR
93 .ad
94 .RS 6n
95 Suppresses the output column of lines duplicated in \fIfile1\fR and
96 \fIfile2\fR.
97 .RE
99 .SH OPERANDS
102 The following operands are supported:
104 .ne 2
106 \fB\fIfile1\fR\fR
108 .RS 9n
109 A path name of the first file to be compared. If \fIfile1\fR is \fB\(mi\fR, the
110 standard input is used.
114 .ne 2
116 \fB\fIfile2\fR\fR
118 .RS 9n
119 A path name of the second file to be compared. If \fIfile2\fR is \fB\(mi\fR,
120 the standard input is used.
123 .SH EXAMPLES
125 \fBExample 1 \fRPrinting a list of utilities specified by files
128 If \fIfile1\fR, \fIfile2\fR, and \fIfile3\fR each contain a sorted list of
129 utilities, the command
132 .in +2
134 example% \fBcomm -23 file1 file2  | comm -23 - file3\fR
136 .in -2
141 prints a list of utilities in \fIfile1\fR not specified by either of the other
142 files. The entry:
145 .in +2
147 example% \fBcomm -12 file1 file2 | comm -12 - file3\fR
149 .in -2
154 prints a list of utilities specified by all three files. And the entry:
157 .in +2
159 example% \fBcomm -12  file2 file3 | comm -23 -file1\fR
161 .in -2
166 prints a list of utilities specified by both \fIfile2\fR and \fIfile3\fR, but
167 not specified in \fIfile1\fR.
169 .SH ENVIRONMENT VARIABLES
172 See \fBenviron\fR(5) for descriptions of the following environment variables
173 that affect the execution of \fBcomm\fR: \fBLANG\fR, \fBLC_ALL\fR,
174 \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
175 .SH EXIT STATUS
178 The following exit values are returned:
180 .ne 2
182 \fB\fB0\fR\fR
184 .RS 6n
185 All input files were successfully output as specified.
189 .ne 2
191 \fB\fB>0\fR\fR
193 .RS 6n
194 An error occurred.
197 .SH ATTRIBUTES
200 See \fBattributes\fR(5) for descriptions of the following attributes:
205 box;
206 c | c
207 l | l .
208 ATTRIBUTE TYPE  ATTRIBUTE VALUE
210 CSI     enabled
212 Interface Stability     Standard
215 .SH SEE ALSO
218 \fBcmp\fR(1), \fBdiff\fR(1), \fBsort\fR(1), \fBuniq\fR(1), \fBattributes\fR(5),
219 \fBenviron\fR(5), \fBstandards\fR(5)