Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Thu, 19 Jun 2003 16:01:56 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: "Siegel, Tom" cc: cygwin AT cygwin DOT com Subject: Re: Writing to the Windows Event Log In-Reply-To: <21C1BC08EDD6F6489EC4C28E38E6AD2B0291F58F@EMAIL.lgmt.trdo> Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 19 Jun 2003, Siegel, Tom wrote: > I would like to be able to write to the Windows event application log > with my shell scripts running on Cygwin. Any "tried and true" solutions > would be appreciated. > > Thanks, > Tom Umm, do you have to do it from a shell script? I'm assuming you want to do this under NT or 2000, right? You could simply use syslog(), you know. Something like #include int main(int argc, char *argv[]) { if (argc != 2) return 1; syslog(LOG_MAKEPRI(LOG_SYSLOG,LOG_ALERT), "%s", argv[1]); } DISCLAIMER: I haven't tested or compiled the above, but it should work pretty much as advertised. Hope this helps, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/