#!/bin/sh
#tail the file you want to watch
tail -fn0 /var/log/logfile | while read line ; do
echo "$line" | grep 'line to react to' | grep -v 'things to block the reaction'
if [ $? = 0 ]
then
# do things
echo "just saw $line"
mpg123 triomph.mp3
fi
done
save this as script.sh
make it exectuable (chmod +x script.sh)
and let it run in the background ./script.sh &