The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #3 (permalink)  
Old 06-15-2006
qfwfq qfwfq is offline
Registered User
  
 

Join Date: Feb 2005
Location: Canada
Posts: 133
Tks Jim. Now what I do is putting the 13th argument of uptime command in a variable, the load, let's say 0.06 and now adding the last 24 hours load and doing an average of the total. Here is what I am trying to do:

Code:
#!/usr/bin/ksh
I_COUNT=96
C_CHAINE=0
until ((I_COUNT < 1))
do

tail -$I_COUNT /dailyload.log | head -1 | awk '{print $13}' > $C_CHAINE

#average
((C_CHAINE=C_CHAINE+$13))
((I_COUNT=I_COUNT-1))

done

((C_CHAINE=C_CHAINE/96))
echo $C_CHAINE
But can't make it work. Any idea?