|
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?
|