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

Join Date: Feb 2005
Location: Canada
Posts: 133
Tail??

Hello all,

I have search the forum and could not find an answer...Here is what I am trying to do. Every 15 minutes, a script send uptime output to a logfile (dailylog.log), that file contains lines like the one below:

Code:
11:21am  up 44 days, 19:15,  1 user,  load average: 0.00, 0.02, 0.03
Now, I am trying to extract only the before last line and send it to another file. The thing is that using tail -2 will show me the last 2 lines... I don't need that last line. The log is growing every 15 minutes so I don't know how many entries there are in the file.

Code:
echo $(tail -10 /dailyload.log)
Does anyone have a suggestion?