The UNIX and Linux Forums  


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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-18-2006
jisc jisc is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 6
Help on scripting using tail

Hi, just need help here, i have this command that i need to run all through out the day, basically this will just monitor a logfile and print a line if theres an error.

tail -f L*|grep "PROCESS IS DEAD"

this will echo a line "*** PROCESS IS DEAD: RW [Signal w/ Core dump: 10] ***" whenever a program logs a dead process error.

what i need is to add a command that will execute every time a line is grep. can someone here help me out.

maybe its something that looks like this but i dont know the syntax.

tail -f L*|grep "PROCESS IS DEAD" -exec mailx "BLAH BLAH" {} \;

can someone help me?