Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 May 2008 17:54:16 -0500
From:      Paul Schmehl <pauls@utdallas.edu>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Shell scripting - suppressing and eliminating error messages
Message-ID:  <A4CB71AD0CF555F6A68D3B27@utd65257.utdallas.edu>
In-Reply-To: <83C71638D3A682FC1B026581@utd65257.utdallas.edu>
References:  <83C71638D3A682FC1B026581@utd65257.utdallas.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
--On Tuesday, May 20, 2008 17:36:26 -0500 Paul Schmehl <pauls@utdallas.edu> 
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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A4CB71AD0CF555F6A68D3B27>