date and time created 88/10/22 16:03:43 by bostic
[unix-history] / usr / src / usr.bin / join / join.1
CommitLineData
765a0daa 1.\" @(#)join.1 6.1 (Berkeley) %G%
9aaec80d 2.\"
765a0daa 3.TH JOIN 1 ""
9aaec80d
KM
4.AT 3
5.SH NAME
6join \- relational database operator
7.SH SYNOPSIS
8.B join
9[
10options
11]
12file1 file2
13.SH DESCRIPTION
14.I Join
15forms, on the standard output,
16a join
17of the two relations specified by the lines of
18.I file1
19and
20.IR file2 .
21If
22.I file1
23is `\-', the standard input is used.
24.PP
25.I File1
26and
27.I file2
28must be sorted in increasing ASCII collating
29sequence on the fields
30on which they are to be joined,
31normally the first in each line.
32.PP
33There is one line in the output
34for each pair of lines in
35.I file1
36and
37.I file2
38that have identical join fields.
39The output line normally consists of the common field,
40then the rest of the line from
41.IR file1 ,
42then the rest of the line from
43.IR file2 .
44.PP
45Fields are normally separated by blank, tab or newline.
46In this case, multiple separators count as one, and
47leading separators are discarded.
48.PP
49These options are recognized:
50.TP
51.BI \-a n
52In addition to the normal output,
53produce a line for each unpairable line in file
54.IR n ,
55where
56.I n
57is 1 or 2.
58.TP
59.BI \-e \ s
60Replace empty output fields by string
61.IR s .
62.TP
63.BI \-j n\ m
64Join on the
65.IR m th
66field of file
67.IR n .
68If
69.I n
70is missing, use the
71.IR m th
72field in each file.
73.TP
74.BI \-o \ list
c72499ab 75Each output line comprises the fields specified in
9aaec80d
KM
76.IR list ,
77each element of which has the form
78.IR n . m ,
79where
80.I n
81is a file number and
82.I m
83is a field number.
84.PP
85.TP
86.BI \-t c
87Use character
88.I c
89as a separator (tab character).
90Every appearance of
91.I c
92in a line is significant.
93.SH "SEE ALSO"
94sort(1), comm(1), awk(1)
95.SH BUGS
96With default field separation,
97the collating sequence is that of
98.IR sort\ \-b ;
99with
100.BR \-t ,
101the sequence is that of a plain sort.
102.PP
103The conventions of
104.I join, sort, comm, uniq, look
105and
106.IR awk (1)
107are wildly incongruous.