From owner-freebsd-questions Thu Feb 21 19:38:58 2002 Delivered-To: freebsd-questions@freebsd.org Received: from femail23.sdc1.sfba.home.com (femail23.sdc1.sfba.home.com [24.0.95.148]) by hub.freebsd.org (Postfix) with ESMTP id 7FA4D37B400; Thu, 21 Feb 2002 19:38:54 -0800 (PST) Received: from there ([68.82.36.167]) by femail23.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with SMTP id <20020222033846.MDLM14626.femail23.sdc1.sfba.home.com@there>; Thu, 21 Feb 2002 19:38:46 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Eric I.Arnoth Reply-To: earnoth@comcast.net To: "Crist J. Clark" Subject: Re: syslog.conf problems Date: Thu, 21 Feb 2002 22:36:02 -0500 X-Mailer: KMail [version 1.3] References: <20020221030958.QQRM18863.femail11.sdc1.sfba.home.com@there> <20020221041623.Q48401@blossom.cjclark.org> In-Reply-To: <20020221041623.Q48401@blossom.cjclark.org> Cc: freebsd-questions@FreeBSD.ORG MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20020222033846.MDLM14626.femail23.sdc1.sfba.home.com@there> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thursday 21 February 2002 07:16, you wrote: > > You'll kick yourself. Is /hello_log.sh set executable? Ugghh....no, it wasn't. Now that I chmod'd it properly, the bourne scipt runs just fine. I then tried to make it echo the line to my python script, thusly: -------------------------------------------------------- #!/bin/sh read line echo "$line" | /hello_log.py -------------------------------------------------------- It works just fine. Thus explaining to me the man page's comments about shell script wrapper to set up the run-once-and-die mechanism. So now that I have the proof of concept, I can do whatever I want in Python, such as parse the output and send it to Postgresql. Thanks much for the simple assist, though I am quite embarassed that it was such a simple detail. I still don't understand why the Python script on it won't run properly. (It is 755 perm ;-) hello_log.py -------------------------------------------------------- #!/usr/local/bin/python import sys test_file = open("/test.out", 'a') test_file.write(sys.__stdin__.read()) test_file.flush() test_file.close() sys.exit() -------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message