On Thu, Jul 03, 2025 at 07:26:03 -0600, Stan Marsh wrote:
> And, finally, again, where can I read about this wonderful "feature"? I
> couldn't find
> it in "man bash".
It's implied by the text in the ARITHMETIC EVALUATION section:
Shell variables are allowed as operands; parameter expansion is perâ
formed before the expression is evaluated. Within an expression, shell
variables may also be referenced by name without using the parameter
expansion syntax. A shell variable that is null or unset evaluates to
0 when referenced by name without using the parameter expansion syntax.
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.
Note "The value of a variable is evaluated as an arithmetic expression"
here. That's a recursive definition.