[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fw: Arithmetic expressions and parameters with newlines breaks
From: |
Jan Schampera |
Subject: |
Fw: Arithmetic expressions and parameters with newlines breaks |
Date: |
Mon, 2 Jul 2007 19:12:42 +0200 |
Begin forwarded message:
Date: Mon, 2 Jul 2007 18:32:49 +0200
From: Jan Schampera <jan.schampera@web.de>
To: bob@proulx.com (Bob Proulx)
Subject: Re: Arithmetic expressions and parameters with newlines breaks
On Mon, 2 Jul 2007 10:08:08 -0600
bob@proulx.com (Bob Proulx) wrote:
> What behavior did you expect to see when the evaluated expression
> contained whitespace? What would you expect from "12 34"? It is not
> a number. It is two numbers. There is no operator between them such
> as "12 + 34" or other.
>
> What other result than a syntax error is possible here?
Hi Bob,
thanks for your reply!
Well, I guess intuitively expected that it evaluates to 0, like for
example:
$ test=string
$ echo $((test))
0
But I just made some experiments (which I should have done before) and
read the manual again a bit closer: In this example I really reference
the variable "string" (as designated operand) which is unset/null and
thus evaluates to 0.
I also saw this can be done in any depth.
So, excuse my wrong interpretion of the manual (maybe that needs to be
marked extra by a sentence or a half in manual). It's definitely not a
bug (it is - between screen and chair!).
Best regards and thanks again for quick reply,
Jan
- Fw: Arithmetic expressions and parameters with newlines breaks,
Jan Schampera <=