On Sun, Feb 14, 1999 at 02:51:40AM -0500, Tim Connolly wrote:
> Syslog typically alerts users with messages, or it sends its message
> to a file (typically in /var/log). Anyone have an idea how I might catch
> this output and redirect it through a script file for each message
> rather than allowing it to dump to a file ?
Yes. You can make a named pipe somewhere:
mknod /tmp/msgs p
Then configure syslog to write what you want to it, eg in /etc/syslog.conf:
*.* |/tmp/msgs
Then get your script to read from /tmp/msgs. New stuff appears in real
time from the pipe, and your script will just wait while there is no
data available. If you don't want it to wait, you can use select(2) to
poll.
Hamish
--
Hamish Moffatt Mobile: +61 412 011 176 [EMAIL PROTECTED]
Rising Software Australia Pty. Ltd.
Developers of music education software including Auralia & Musition.
31 Elmhurst Road, Blackburn, Victoria Australia, 3130
Phone: +61 3 9894 4788 Fax: +61 3 9894 3362 USA Toll Free: 1-888-667-7839
Internet: http://www.rising.com.au/