Re: Shell scripting - suppressing and eliminating error messages

2008-05-23 Thread Oliver Fromme
Paul Schmehl wrote: --On Tuesday, May 20, 2008 17:36:26 -0500 Paul Schmehl [EMAIL PROTECTED] wrote: if ( ${BATCH} ); then [...] 1: not found Never mindforgot to use [ ] for test instead of ( ). If the value of $BATCH is always either 0 and 1, a neat trick is to define two

Re: Shell scripting - suppressing and eliminating error messages

2008-05-20 Thread Paul Schmehl
--On Tuesday, May 20, 2008 17:36:26 -0500 Paul Schmehl [EMAIL PROTECTED] 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

Re: Shell scripting - suppressing and eliminating error messages

2008-05-20 Thread Chuck Swiger
Hi, Paul-- On May 20, 2008, at 3:36 PM, Paul Schmehl wrote: I'm using the following construction in a pkg-deinstall script for a port I maintain: if ( ${BATCH} ); then [ ... ] Why is this error printing to stdout and how can I suppress it? Or is there a flaw in the logic that, if fixed,

Re: Shell scripting - suppressing and eliminating error messages

2008-05-20 Thread Jonathan Chen
On Tue, May 20, 2008 at 05:36:26PM -0500, Paul Schmehl wrote: I'm using the following construction in a pkg-deinstall script for a port I maintain: if ( ${BATCH} ); then This should read: if [ -n ${BATCH} ] ; then -- Jonathan Chen [EMAIL PROTECTED]