gorn.ch

Tobias Ebnöther's personal blog

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:

#!/bin/sh
if [ -z "$1" ]; then
echo "Missing filename"
exit 1
fi

tail -n0 -F $1 | while read; do
echo $REPLY | growlnotify -a tailfgrowl -t $1;
done

The usage is simple as hell just do it like this:

tailf2growl /var/log/httpd/error_log 
Related Entries:
NetNewsWire Lite vs Vienna memory usage
Living with Terminal.app
Fixing the delete key in Terminal.app
Nice screenrc and common keystokes
xchat on OSX / Command as alt
Comments (3)  Permalink
Powered by Flux CMS