From owner-freebsd-questions@FreeBSD.ORG Tue May 20 22:43:39 2008 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 796701065684 for ; Tue, 20 May 2008 22:43:39 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from smtp3.utdallas.edu (smtp3.utdallas.edu [129.110.20.110]) by mx1.freebsd.org (Postfix) with ESMTP id 2C40E8FC0A for ; Tue, 20 May 2008 22:43:38 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from utd65257.utdallas.edu (utd65257.utdallas.edu [129.110.3.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTPSA id 5D58423DFA for ; Tue, 20 May 2008 17:36:26 -0500 (CDT) Date: Tue, 20 May 2008 17:36:26 -0500 From: Paul Schmehl To: FreeBSD Questions Message-ID: <83C71638D3A682FC1B026581@utd65257.utdallas.edu> X-Mailer: Mulberry/4.0.8 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Shell scripting - suppressing and eliminating error messages 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, 20 May 2008 22:43:39 -0000 I'm using the following construction in a pkg-deinstall script for a port I maintain: if ( ${BATCH} ); then The idea is, if you type make BATCH=1 deinstall, the port will deinstall without running an interactive portion of the pkg-deinstall script. If you type make deinstall, the pkg-deinstall script runs. The script works, but, when you use BATCH=1, it generates an error message: # make BATCH=1 deinstall clean ===> Deinstalling for security/sguil-server ===> Deinstalling sguil-server-0.7.0_1 Stopping sguild...... sguild not running? 1: not found Why is this error printing to stdout and how can I suppress it? Or is there a flaw in the logic that, if fixed, would resolve this problem? -- Paul Schmehl As if it wasn't already obvious, my opinions are my own and not those of my employer.