From owner-freebsd-questions@FreeBSD.ORG Fri Jun 8 13:00:15 2007 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D177816A41F for ; Fri, 8 Jun 2007 13:00:15 +0000 (UTC) (envelope-from robin@reportlab.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by mx1.freebsd.org (Postfix) with ESMTP id 6FA8113C484 for ; Fri, 8 Jun 2007 13:00:15 +0000 (UTC) (envelope-from robin@reportlab.com) Received: by ug-out-1314.google.com with SMTP id u2so1079174uge for ; Fri, 08 Jun 2007 06:00:14 -0700 (PDT) Received: by 10.82.127.14 with SMTP id z14mr5326381buc.1181307613922; Fri, 08 Jun 2007 06:00:13 -0700 (PDT) Received: from ?192.168.0.3? ( [217.196.247.135]) by mx.google.com with ESMTP id 31sm365965nfu.2007.06.08.06.00.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 08 Jun 2007 06:00:13 -0700 (PDT) Message-ID: <466952D9.2050903@chamonix.reportlab.co.uk> Date: Fri, 08 Jun 2007 14:00:09 +0100 From: Robin Becker User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: FreeBSD Questions Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: detect stderr writes when combined X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2007 13:00:15 -0000 This is possibly a stupid question, but I would like to have a particular sh script stdout and stderr combined, but at least detect when stderr has been used. In particular for my cron scripts it seems that error messages get wrapped up and emailed, but they are then out of context with the normal informative output. If I could have the combined output go to my logs in the normal way and detect that some error output had occurred I could then email the whole cron output. I'm fairly sure this is doable with some C, but is there an easier way? -- Robin Becker