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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #13 (permalink)  
Old 05-20-2008
timj123 timj123 is offline
Registered User
 

Join Date: Jan 2008
Posts: 63
Thanks ruben.

I am still having issues with sorting these arrays with awk. This is what I have now:

Code:
END {
for ( i in x )
if ( i != "0-0" ) {
printf "%s\n",i | "sort -nk 1 > /tmp/a.out 2>&1"}
while ( (getline < "/tmp/a.out") > 0 )
sort[$1]
for ( s in sort )
printf "%s\n",s }
I was hoping that awk printed out indices in the order received. When I check "/tmp/a.out" indices ARE in sorted order, but when I re-assign and loop thru them, they are not.

Any awkologist that can help would be very much appreciated.

Thanks
Reply With Quote