Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

join(1) OSS Shell and Utilities Reference Manual
NAME
join - Joins the lines of two les
SYNOPSIS
Current syntax
join [-a lenum_a]
[-e string]
[-o number.eld, ... ]
[-t character]
[-v lenum_v]
[-1 eld1][-2 eld2]
le1 le2
Obsolescent syntax
join [-a lenum_a]
[-e string]
[-j num | eld | num d]
[-o number.eld, ...]
[-t character]
le1 le2
FLAGS
-1 field1 Species the number of the join eld for le1. eld1 is a decimal integer starting with
1.
-2 field2 Species the number of the join eld for le2. eld2 is a decimal integer starting with
1.
-a filenum_a
Produces an output line for each unmatched line found in le1 if lenum_a is 1 or in
le2 if number is 2. Without -a, join produces output only for lines containing a
matching eld. If both -a 1 and -a 2 are used, the output contains all unmatched lines.
-e string Replaces empty output elds with string.
-j num | fld | num fld
(Obsolescent) Species the join eld d for le num, where num is 1 for le1 or 2 for
le2. If you do not specify num, join uses d in both les. Without -j, join uses the
rst eld in each le. The default value for both num and d is 1.
If you enter only a 1 or a 2 as an argument to -j, join interprets this argument as the le
number (num); integers greater than 2 are interpreted as the eld number (d). There-
fore, if you want to specify a eld number of 1 or 2, you must precede the d
specication with a num argument; otherwise, the join command interprets the 1 or 2
as the le number (num).
-o number.field
Produces output lines consisting of the elds given by one or more number.eld argu-
ments in the specied order, where number is 1 for le1 or 2 for le2 and eld is a eld
number. Multiple -o arguments should be separated with commas.
-t character
Uses character (a single character) as the eld separator character in the input and the
output. Every appearance of character in a line is signicant. The default separator is
a space. If you do not specify -t, join also recognizes the tab and newline characters as
separators.
With default eld separation, the collating sequence is that of sort -b. If you specify -t,
458 Hewlett-Packard Company 527188-004