From owner-freebsd-questions@FreeBSD.ORG Tue Apr 19 14:01:04 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B55CC106564A for ; Tue, 19 Apr 2011 14:01:04 +0000 (UTC) (envelope-from bsemene@cyanide-studio.com) Received: from mail.cyanide-studio.com (mail.cyanide-studio.com [62.73.7.64]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3D68FC16 for ; Tue, 19 Apr 2011 14:01:04 +0000 (UTC) Received: from localhost (unknown [10.1.8.14]) by mail.cyanide-studio.com (Postfix) with ESMTP id 94BA617BF446 for ; Tue, 19 Apr 2011 16:01:02 +0200 (CEST) Received: from mail.cyanide-studio.com ([10.1.8.3]) by localhost (mailguard.cyanide-studio.com [10.1.8.14]) (amavisd-maia, port 10024) with ESMTP id 64391-03 for ; Tue, 19 Apr 2011 16:01:02 +0200 (CEST) Received: from [10.1.8.96] (unknown [10.1.8.96]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: bsemene@cyanide-studio.com) by mail.cyanide-studio.com (Postfix) with ESMTP id 6CF0817BF442 for ; Tue, 19 Apr 2011 16:01:02 +0200 (CEST) Message-ID: <4DAD9594.8030108@cyanide-studio.com> Date: Tue, 19 Apr 2011 16:00:52 +0200 From: Bastien Semene User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: redirecting command output depending on exit status 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: Tue, 19 Apr 2011 14:01:04 -0000 Hi list, I have a cron task set up using lockf. I'd like to redirect one exit status to /dev/null : "it (lockf command) returns one of the exit codes defined in sysexits(3), as follows: EX_TEMPFAIL The specified lock file was already locked by another process. EX_CANTCREAT The lockf utility was unable to create the lock file, e.g., because of insufficient access privileges. EX_USAGE There was an error on the lockf command line. EX_OSERR A system call (e.g., fork(2)) failed unexpectedly. EX_SOFTWARE The command did not exit normally, but may have been sig- naled or stopped." I don't care about the EX_TEMPFAIL output as I consider it as a successful exit status, not an error. I there a trick to do that in a short way ? -- Bastien Semene Administrateur Réseau& Système Cyanide Studio - FRANCE