[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I make a portable test??

From: Eric Siegerman
Subject: Re: How do I make a portable test??
Date: Fri, 14 Feb 2003 19:35:40 -0500
User-agent: Mutt/1.2.5i

On Fri, Feb 14, 2003 at 06:41:04PM +0000, Dr. David Kirkby wrote:
> Eric Siegerman wrote:
> AC_HAVE_HEADERS(gsl/gsl_sf_ellint.h,[gsl_inc_count=$(($gsl_inc_count +
> 1))])

Right; "$((expr))" -- "arithmetic expansion" it's called in
ksh(1) -- is another nonstandard extension.

The Bourne-shell way to say x=x+1 is:
        x=`expr $x + 1`
or to be paranoid, as someone else pointed out:
        x=`expr "0$x" + 1`
But of course that breaks if $x is negative...


|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
A distributed system is one on which I cannot get any work done,
because a machine I have never heard of has crashed.
        - Leslie Lamport

reply via email to

[Prev in Thread] Current Thread [Next in Thread]