bug-bash
[Top][All Lists]
Advanced

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

Re: Inconsistent arithmetic evaluation of parameters


From: Dennis Williamson
Subject: Re: Inconsistent arithmetic evaluation of parameters
Date: Tue, 1 Sep 2015 18:32:42 -0500



On Tue, Sep 1, 2015 at 4:24 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
Dennis Williamson <dennistwilliamson@gmail.com> writes:

> $ echo $((foo))  # expansion succeeds, indirection fails
> dash: 4: Illegal number: bar

The indirection didn't fail, it just didn't produce a number, so the
_expression_ is malformed.

Andreas.

--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

I disagree. The _expansion_ produced "bar" which is an "Illegal number" because the indirection (turning "bar" into 5) didn't succeed. In Bash, the indirection would have succeeded and the output would have been 5.

--
Visit serverfault.com to get your system administration questions answered.

reply via email to

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