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

join(1) OSS Shell and Utilities Reference Manual
Wozni 555-1234
and names contains this listing of names and department numbers:
Eisner Dept. 389
Frost Dept. 217
Green Dept. 311
Takata Dept. 454
Wozni Dept. 520
then join phonedir names displays:
Eisner 555-1234 Dept. 389
Green 555-2240 Dept. 311
Takata 555-5341 Dept. 454
Wozni 555-1234 Dept. 520
Each line consists of the join field found in both files (the last name), fol-
lowed by the rest of the line found in phonedir, followed by the rest of
the line found in names.
2. To display unmatched lines in names as well as matched lines in both
files, enter:
join -a 2 phonedir names
If phonedir contains:
Binst 555-6235
Dickerson 555-1842
Eisner 555-1234
Green 555-2240
Hrarii 555-0256
Janatha 555-7358
Lewis 555-3237
Takata 555-5341
Wozni 555-1234
and names contains:
Eisner Dept. 389
Frost Dept. 217
Green Dept. 311
Takata Dept. 454
Wozni Dept. 520
then join -a 2 phonedir names displays:
Eisner 555-1234 Dept. 389
Frost Dept. 217
Green 555-2240 Dept. 311
Takata 555-5341 Dept. 454
Wozni 555-1234 Dept. 520
This command performs the same join operation as in the first example
and also lists the lines of names that have no match in phonedir (the
entry for Frost).
468 Hewlett-Packard Company 527188-021