[TriLUG] bash script - join question

Shawn Hood shawnlhood at gmail.com
Tue Oct 24 14:06:35 EDT 2006


I am trying to perform a join on two separate files.  They are
essentially look-up tables with a common key in the first field.  It
seems to only be matching the first row of one of the files.  Any
ideas?

Contents of file1:
INT9 00:11:25:fe:ab:c6
INT3 00:14:5e:1d:bb:c2
INT1 00:14:5e:1d:cb:0e

Contents of file2:
INT1    10.40.21.1
INT2    10.40.21.2
INT3    10.40.21.3
INT4    10.40.21.4
INT5    10.40.21.5
INT6    10.40.21.6
INT7    10.40.21.7
INT8    10.40.21.8
INT9    10.40.21.9

Join syntax:
join file1 file2

Results:
INT9 10.40.21.9 00:11:25:fe:ab:c6

Desired results in no particular order:
INT9 10.40.21.9 00:11:25:fe:ab:c6
INT3 10.40.21.3 00:14:5e:1d:bb:c2
INT1 10.40.21.1 00:14:5e:1d:cb:0e



-- 
Shawn Hood
(910) 670-1819 Mobile



More information about the TriLUG mailing list