> The existing documentation seems pretty clear:
> ...
> The value of a variable is evaluated as an arithmetic  expression  when
> it  is  referenced, or when a variable which has been given the integer
> attribute using declare -i is assigned a value.  A null value evaluates
> to  0.   A shell variable need not have its integer attribute turned on
> to be used in an expression.

Hi Chet,

I've reread that paragraph a number of times. It could be improved to
help the end-user.

After the sentence:

"The value of a variable is evaluated as an arithmetic expression 
when it is referenced, ..."

Add the sentence:

This evaluation of the variables value will be performed 
recursively until an arithmetic evaluation is found or
the expression recursion level exceeded.

For example:

unset a; declare a="a"; [[ a -lt 3 ]]; echo $?
bash: [[: a: expression recursion level exceeded (error token is "a")
1

Shouldn't the return code from this expression be 2, rather than 1?

Thank you.
Peg


Reply via email to