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

join(1) OSS Shell and Utilities Reference Manual
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 eld found in both les (the last name), followed 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 les, 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 rst example and also lists the
lines of names that have no match in phonedir (the entry for Frost).
3. To perform a join operation and display selected elds, enter:
join -o 2.3,2.1,1.2 phonedir names
This command displays the following elds in this order:
Field 3 of names (department number without "Dept.")
Field 1 of names (last name)
Field 2 of phonedir (telephone number)
460 Hewlett-Packard Company 527188-004