Comparing the two files using awk script

view full story

http://www.unix.com – Hi all, Can you please help me to find out that where is the problem in my script or either my way of writing the shell command on the prompt is not right? Actually, I want to compare the second column "$1" of the file "t1" with all the columns of second file "t2", if there is a match then the script should return the matched column. But currently my script is printing the whole data of the first file "t1". I will highly appreciate any feedback and suggestions. I badly need to fix this problem as soon as possible; therefore any quick response will be ac (HowTos)