The UNIX and Linux Forums  


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




Thread: Output File
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 06-26-2006
charbel charbel is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 41
If you dont mind, can you explain to me how does the below work, i am not that much expert in unix. I want to try it but at least i need to understand what each parameter mean so that i will be able to load it to my script.


Quote:
Originally Posted by vgersh99
nawk -f char.awk fileFROMscript fileWithAllAccounts

char.awk:

Code:
FNR==NR {arr[$2] += $1; next }
{
   printf("%d%s%s\n", ($1 in arr) ? arr[$1] : 0, OFS, $1)
}

Thanks for your help.