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