Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)

join(1) OSS Shell and Utilities Reference Manual
NAME
join - Joins the lines of two files
SYNOPSIS
Current syntax
join [-a filenum_a]
[-e string]
[-o number.field , ... ]
[-t character]
[-v filenum_v]
[-1 field1][-2 field2]
file1 file2
Obsolescent syntax
join [-a filenum_a]
[-e string]
[-j num | field | num fld]
[-o number.field , ...]
[-t character]
file1 file2
FLAGS
-1 field1 Specifies the number of the join field for file1. field1 is a decimal
integer starting with 1.
-2 field2 Specifies the number of the join field for file2. field2 is a decimal
integer starting with 1.
-a filenum_a
Produces an output line for each unmatched line found in file1 if
filenum_a is 1 or in file2 if number is 2. Without -a, join produces out-
put only for lines containing a matching field. If both -a 1 and -a 2 are
used, the output contains all unmatched lines.
-e string Replaces empty output fields with string.
-j num | fld | num fld
(Obsolescent) Specifies the join field fld for file num, where num is 1
for file1 or 2 for file2. If you do not specify num, join uses fld in both
files. Without -j, join uses the first field in each file. The default value
for both num and fld is 1.
If you enter only a 1 or a 2 as an argument to -j, join interprets this
argument as the file number (num); integers greater than 2 are inter-
preted as the field number (fld). Therefore, if you want to specify a
field number of 1 or 2,
you must precede the fld specification with a
num argument; otherwise, the join command interprets the 1 or 2 as the
file number (num).
-o number.field
Produces output lines consisting of the fields given by one or more
number.field arguments in the specified order, where number is 1 for
file1 or 2 for file2 and field is a field number. Multiple -o arguments
should be separated with commas.
466 Hewlett-Packard Company 527188-021