I'm trying to join two simple files in Solaris 5.8 Version as below:~/temp/s: cat 1work1 a 8058 51work2 b 15336 51~/temp/s: cat 28058 77-11:29:32 /apps/sas15336 100-12:23:49 /local/hotfix~/temp/s: join -1 3 -2 1 1 28058 work1 a 51 77-11:29:32 /apps/sas (The other line is missing from the output)The output only contains one record where it should be two. I'm really not sure where it went wrong.Is there any way we may get all the records in the output?
Join command gives incorrect output?
solaris;join
I think this might be a bug with join. I just tried it on Fedora 14 using this version of join:$ join --versionjoin (GNU coreutils) 8.5Example$ join -1 3 -2 1 1 28058 work1 a 51 77-11:29:32 /apps/sas15336 work2 b 51 100-12:23:49 /local/hotfixAlternativeYou could use awk to do this:$ awk 'NR==FNR{_[$3]=$3;next}$1 in _{print _[$1],$0}' 1 28058 8058 77-11:29:32 /apps/sas15336 15336 100-12:23:49 /local/hotfix