[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inconsistent arithmetic evaluation of parameters
From: |
Greg Wooledge |
Subject: |
Re: Inconsistent arithmetic evaluation of parameters |
Date: |
Tue, 1 Sep 2015 16:23:08 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Sep 01, 2015 at 03:13:57PM -0500, Dennis Williamson wrote:
> The version of dash I have handy (0.5.7) has math support which IMHO is
> broken:
>
> $ foo=bar
> $ bar=5
> $ echo $foo
> bar
> $ echo $((foo))
> dash: 4: Illegal number: bar
> $ echo $(($foo))
> 5
> $ echo $((bar))
> 5
> $ echo $(($bar))
> 5
>
> Note the inconsistency in support of omitting the inner dollar sign.
$foo is expanded to bar, so the following two lines are always going to
be equivalent:
echo $(($foo))
echo $((bar))
POSIX also specifies (vaguely!!) that $((x)) and $(($x)) are equivalent.
- Inconsistent arithmetic evaluation of parameters, Clint Hepner, 2015/09/01
- Re: Inconsistent arithmetic evaluation of parameters, Greg Wooledge, 2015/09/01
- Re: Inconsistent arithmetic evaluation of parameters, Dennis Williamson, 2015/09/01
- Re: Inconsistent arithmetic evaluation of parameters,
Greg Wooledge <=
- Re: Inconsistent arithmetic evaluation of parameters, Dennis Williamson, 2015/09/01
- Re: Inconsistent arithmetic evaluation of parameters, Andreas Schwab, 2015/09/01
- Re: Inconsistent arithmetic evaluation of parameters, Dennis Williamson, 2015/09/01
- Re: Inconsistent arithmetic evaluation of parameters, Andreas Schwab, 2015/09/02
- Re: Inconsistent arithmetic evaluation of parameters, Dennis Williamson, 2015/09/02
- Re: Inconsistent arithmetic evaluation of parameters, Greg Wooledge, 2015/09/02
- Re: Inconsistent arithmetic evaluation of parameters, Chet Ramey, 2015/09/02
- Re: Inconsistent arithmetic evaluation of parameters, Greg Wooledge, 2015/09/02
- Re: Inconsistent arithmetic evaluation of parameters, Chet Ramey, 2015/09/03
- Re: Inconsistent arithmetic evaluation of parameters, Chet Ramey, 2015/09/02