[TriLUG] Re: bash script - join question

Ron Yorgason ron at tritechs.net
Tue Oct 24 14:37:19 EDT 2006


I don't see a convenient way to do it without sorting, but sorting the 
files is really easy:

sort file1 > sort1; sort file2 > sort2; join sort1 sort2

That gave me the output:
INT1 00:14:5e:1d:cb:0e 10.40.21.1
INT3 00:14:5e:1d:bb:c2 10.40.21.3
INT9 00:11:25:fe:ab:c6 10.40.21.9


Shawn Hood wrote:
> Seems as if the key on which the files are joined must be in order
> within both files.  Any ways around this without sorting?
>
> Shawn




More information about the TriLUG mailing list