The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 03-16-2008
Franklin52 Franklin52 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,316
Quote:
Originally Posted by yunccll View Post
it's no need to use awk! using join is ok, :-) and how to use awk?

.Aaron
But you're using join, 3 times sort and 2 temporary files!

With awk:

Code:
awk 'NR==FNR{a[$1]=$2;next}$3 in a{print $0 a[$1]" "a[$3]}' y.txt x.txt
Regards