The UNIX and Linux Forums  

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




Thread: Tail??
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 06-15-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,807
It looks like you are taking the last 96 lines from the log and finding the mean of column 13.


Code:
tail -96 logfile | \
awk 'BEGIN { total=0 } { total+=$13 } END{ printf("Avg=%f\n", total/NR) }'

if I understood what you want.