home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / sbin / pmonitork.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2004-02-12  |  384 b   |  17 lines

  1. #!/bin/sh
  2. # log a file tail
  3.  
  4. #Xdialog --title "Monitoring tail of $1" --smooth --fixed-font --no-cancel --ok-label "Exit" --tailbox $1 18 95
  5.  
  6. LINES1=0
  7. LINES2=0
  8. while [ 1 ];do
  9.  LINES2=`wc -l /var/log/messages | tr -s " " | cut -f 2 -d " "`
  10.  if [ $LINES2 -gt $LINES1 ];then
  11.   LINESDIFF=`expr $LINES2 - $LINES1`
  12.   tail -n $LINESDIFF /var/log/messages
  13.   LINES1=$LINES2
  14.  fi 
  15.  sleep 1
  16. done
  17.