Make LCALL like LJMP and avoid segmentation faults parsing segments (!).
[unix-history] / usr / src / usr.bin / comm / comm.1
CommitLineData
b5dc1377 1.\" Copyright (c) 1989, 1990 The Regents of the University of California.
a6d8385c
KB
2.\" All rights reserved.
3.\"
b5dc1377 4.\" %sccs.include.redist.man%
a6d8385c 5.\"
0e853b88 6.\" @(#)comm.1 6.5 (Berkeley) %G%
d3b83d9f 7.\"
b5dc1377 8.Dd
0e853b88 9.Os
b5dc1377
CL
10.Dt COMM 1
11.Sh NAME
12.Nm comm
13.Nd select or reject lines common to two files
14.Sh SYNOPSIS
15.Nm comm
16.Op Fl 123
17.Ar file1 file2
18.Sh DESCRIPTION
a6d8385c 19The
b5dc1377 20.Nm comm
a6d8385c 21utility reads
b5dc1377 22.Ar file1
d3b83d9f 23and
b5dc1377
CL
24.Ar file2 ,
25which should be
26sorted lexically, and produces three text
27columns as output: lines only in
28.Ar file1 ;
d3b83d9f 29lines only in
b5dc1377 30.Ar file2 ;
d3b83d9f 31and lines in both files.
b5dc1377 32.Pp
5325ced3 33The filename
0e853b88 34.Ql Fl
5325ced3 35means the standard input.
b5dc1377 36.Pp
a6d8385c 37The following options are available:
0e853b88
CL
38.Bl -tag -width Ds
39.It Fl 1
a6d8385c 40Suppress printing of column 1.
0e853b88 41.It Fl 2
a6d8385c 42Suppress printing of column 2.
0e853b88 43.It Fl 3
a6d8385c 44Suppress printing of column 3.
0e853b88 45.El
b5dc1377 46.Pp
a6d8385c
KB
47Each column will have a number of tab characters prepended to it
48equal to the number of lower numbered columns that are being printed.
49For example, if column number two is being suppressed, lines printed
50in column number one will not have any tabs preceding them, and lines
51printed in column number three will have one.
b5dc1377
CL
52.Pp
53.Nm Comm
a6d8385c
KB
54assumes that the files are lexically sorted; all characters
55participate in line comparisons.
b5dc1377
CL
56.Pp
57.Nm Comm
a6d8385c 58exits 0 on success, >0 if an error occurred.
b5dc1377
CL
59.Sh SEE ALSO
60.Xr cmp 1 ,
61.Xr diff 1 ,
62.Xr sort 1 ,
63.Xr uniq 1
64.Sh STANDARDS
65The
66.Nm comm
0e853b88 67command is expected to be POSIX 1003.2 compatible.