tail -f to growl
What I'd like to do is to observe a file with growl (the apache error_log in my case). Getting inspired by this article I wrote a little script called tailf2growl just copy it to /usr/local/bin/tailf2growl or something:
if [ -z "$1" ]; then
echo "Missing filename"
tail -n0 -F $1 | while read; do
echo $REPLY | growlnotify -a tailfgrowl -t $1;
The usage is simple as hell just do it like this:
How i can implement this script with Grep or something, so i can show lines containing, say, only PUT messages?
Just extend the growlnotify call to something like this:
echo $REPLY | grep PUT | growlnotify -a tailfgrowl -t $1;