From owner-freebsd-questions@FreeBSD.ORG Tue May 20 22:54:16 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 A41A8106566B for ; Tue, 20 May 2008 22:54:16 +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 8C3F38FC24 for ; Tue, 20 May 2008 22:54:16 +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 31CB323DF5 for ; Tue, 20 May 2008 17:54:16 -0500 (CDT) Date: Tue, 20 May 2008 17:54:16 -0500 From: Paul Schmehl To: FreeBSD Questions Message-ID: In-Reply-To: <83C71638D3A682FC1B026581@utd65257.utdallas.edu> References: <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: Re: 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:54:16 -0000 --On Tuesday, May 20, 2008 17:36:26 -0500 Paul Schmehl wrote: > 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? Never mind....forgot to use [ ] for test instead of ( ). My perl is getting in the way of my shell. :-( -- Paul Schmehl As if it wasn't already obvious, my opinions are my own and not those of my employer.