file 1:
/export/home/path1
host1 (variables)
host2 (variables)
host3 (variables)
/export/home/path2
host1 (variables)
host5 (variables)
/export/home/path3
host2 (variables)
file 2:
/export/home/path1
host2 (variables)
host3 (variables)
192.168.1.1 (variables)
10.0.0.1 (variables)
/export/home/path2
host1 (variables)
/export/home/path8
host7 (variables)
Desired:
/export/home/path1
host1 (variables)
host2 (variables) host2 (variables)
host3 (variables) host3 (variables)
192.168.1.1 (variables)
10.0.0.1 (variables)
/export/home/path2
host1 (variables)
host5 (variables)
host1 (variables)
/export/home/path3
host2 (variables)
/export/home/path8
host7 (variables)
I've tried something like this:
but this isn't giving me what I want.
Thanks
/export/home/path1
host1 (variables)
host2 (variables)
host3 (variables)
/export/home/path2
host1 (variables)
host5 (variables)
/export/home/path3
host2 (variables)
file 2:
/export/home/path1
host2 (variables)
host3 (variables)
192.168.1.1 (variables)
10.0.0.1 (variables)
/export/home/path2
host1 (variables)
/export/home/path8
host7 (variables)
Desired:
/export/home/path1
host1 (variables)
host2 (variables) host2 (variables)
host3 (variables) host3 (variables)
192.168.1.1 (variables)
10.0.0.1 (variables)
/export/home/path2
host1 (variables)
host5 (variables)
host1 (variables)
/export/home/path3
host2 (variables)
/export/home/path8
host7 (variables)
I've tried something like this:
Code:
NR==FNR {
a[FNR]=$2
c=FNR
next
}
{
for(i=1;i<=c;i++) {
print a[i],$3
}
}
Thanks