 |
 |
piping into growlnotify
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2000
Status:
Offline
|
|
I'm trying to pipe "tail -f" into a terminal application called growlnotify (used to display messages in nice bezels on the screen). Problem is, growlnotify expects some kind of "end of stream" in the piped-in message, otherwise it won't fire off the message.
Surely there must be some way of going around this, like using sed to add an end-marker, or piping "tail -f" into a shell script that calls growlnotify explicitly as soon as something happens in the file I'm tailing.
What should I do? Any suggestions?
P.S I've searched the growl.info forums. Others have asked the same question - seems nobody has the solution though, so I though I'd try my luck here at macnn...
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status:
Offline
|
|
Originally Posted by cla
P.S I've searched the growl.info forums. Others have asked the same question - seems nobody has the solution though, so I though I'd try my luck here at macnn...
Sounds cool, I haven't done much with growlnotify. I don't know how active the growl forums are, but I have hung out with the developers on IRC. Even if the devs aren't around, there are bunches of people in the channel that would ptobably be able to point you in the right direction. You can find them at:
irc.freenode.net #growl
|
"In Nomine Patris, Et Fili, Et Spiritus Sancti"
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Aug 2002
Status:
Offline
|
|
growlnotify has a commandline option you can use instead,
Code:
growlnotify title -m "message"
you're going to need more than just tail -f to get the data to growlnotify
the two simple choices are a cron job and an applescript / shell script you keep running in the background and polling the file.
--Will
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2000
Status:
Offline
|
|
[quote=clam2000]
Code:
growlnotify title -m "message"
"growlnotify" actually is the command line option. The whole app is simply named "growl".
What I'm doing is a
tail -f /var/log/apache/access.log | growlnotify -t "New hit!"
The above line works fine if I use cat instead of tail -f...
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2000
Status:
Offline
|
|
Got it:
tail -fn1 apache.log|. call_growl.sh
The pipe above could first be nicely filtered and arranged using for instance awk.
call_growl.sh look like:
#/bin/sh
while read visitor
do
growlnotify -t "web hit" -m $visitor
done
A very supervising feeling indeed...
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status:
Offline
|
|
You'll regret that the day you post your server's address to Slashdot 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2000
Status:
Offline
|
|
That would constitute an example of what I usually refer to as a »pleasant« problem...
:>
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |