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 -->
  #2 (permalink)  
Old 03-16-2008
yunccll yunccll is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 23

Code:
>cat x.txt
z 11 az
x 12 ax
y 13 ay
>cat y.txt
ay TT
ax NN


Code:
>sort x.txt > sx.tmp && sort y.txt > sy.tmp && join -1 3 -2 1 -o "1.1 1.2 1.3 2.2" sx.tmp sy.tmp | sort -r && rm -fr *.tmp
y 13 ay TT
x 12 ax NN

it's no need to use awk! using join is ok, :-) and how to use awk?

.Aaron