#!/bin/sh
# 
# Written by:
# -- 
# John L. Weatherwax                2006-06-01
# 
# email: wax@alum.mit.edu
# 
# Please send comments and especially bug reports to the
# above email address.
# 
#-----

# First sort the files with respect to their first field:
sort file1 > file1.sorted
sort file2 > file2.sorted

# Join them on their first field:
join -j1 1 -j2 1 file1.sorted file2.sorted

# Clean up:
rm file1.sorted file2.sorted
