Does anyone know how to use the join command? I have been trying and am not having any luck.
file1:
host1 [tab] xx.xxx.xx.xxx [tab] ce1
host2 [tab] xx.yyy.yy.yyy [tab] bge2
.
.
.
file2:
host1-app [tab] xx.xxx.xx.xxx
host4-mgt [tab] xx.xxx.yy.xxx
host2-mgt [tab] xx.yyy.yy.yyyy
.
.
.
What I want is to join the two files based on the IP fields, which are $2 in file1 and $2 in file2.
The result would be:
host1 [tab] xx.xxx.xx.xxx [tab] ce1 [tab] host1-app
host2 [tab] xx.yyy.yy.yyy [tab] bge2 [tab] host2-mgt
Thanks.
file1:
host1 [tab] xx.xxx.xx.xxx [tab] ce1
host2 [tab] xx.yyy.yy.yyy [tab] bge2
.
.
.
file2:
host1-app [tab] xx.xxx.xx.xxx
host4-mgt [tab] xx.xxx.yy.xxx
host2-mgt [tab] xx.yyy.yy.yyyy
.
.
.
What I want is to join the two files based on the IP fields, which are $2 in file1 and $2 in file2.
The result would be:
host1 [tab] xx.xxx.xx.xxx [tab] ce1 [tab] host1-app
host2 [tab] xx.yyy.yy.yyy [tab] bge2 [tab] host2-mgt
Thanks.