Re: process result code in if

2013-06-07 Thread Tim Rice
On Fri, 7 Jun 2013, A.P. Horst wrote: > Thanks for all the great input! Seems google isn't always your best friend, at > least not when it comes to autoconf. The solution with the test command is > very elegant and readable. > I ended up using this: > if ! test $var -gt 0 > /dev/null 2>&1; then >

Re: process result code in if

2013-06-07 Thread Andres Perera
On Thu, Jun 6, 2013 at 8:11 AM, Eric Blake wrote: > - Original Message - > >> >> A more robust, (and more portable), formulation may be: >> >> echo $var | grep '^+\{0,1\}[0-9]\{1,\}$' > /dev/null 2>&1 > > Why fork, when straight shell will do? yea, forking for grep is probably going to

RE: implement workaround for header files

2013-06-07 Thread Daily, Jeff A
> -Original Message- > From: autoconf-bounces+jeff.daily=pnl@gnu.org [mailto:autoconf- > bounces+jeff.daily=pnl@gnu.org] On Behalf Of Peter Johansson > Sent: Thursday, June 06, 2013 5:04 PM > To: Autoconf Mailing List > Subject: implement workaround for header files > > Hi autoconf

Re: process result code in if

2013-06-07 Thread Miles Bader
Tim Rice writes: > On Fri, 7 Jun 2013, A.P. Horst wrote: >> if ! test $var -gt 0 > /dev/null 2>&1; then > > "if ! test ..." is definitely not portable. Hmmm, I can never remember which is the portable one, but from the autoconf docs, one should usually use "if test ! ..." instead : It is s