Chet Ramey: > I think the basic misunderstanding here is caused by confusion (partially > abetted by the manual page) about what exactly constitutes `arithmetic > expansion'. Arithmetic expansion is $((...)). Arithmetic *evaluation* > is what happens to the value assigned to a variable previously given the > integer attribute. I will change the documentation to distinguish the > cases.
comparing the 2.05 and the current documentation - The section "Arithmetic Expansion" is unchanged. - "ARITHMETIC EVALUATION" adds the "declare" builtin, and changes the paragraph Shell variables are allowed as operands; parameter expansion is performed before the expression is evaluated. Within an expression, shell variables may also be referenced by name without using the parameter expansion syntax. The value of a variable is evaluated as an arithmetic expression when it is referenced. A shell variable need not have its integer attribute turned on to be used in an expression. to (changes in [[...]]) Shell variables are allowed as operands; parameter expansion is performed 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. - The section "Simple Command Expansion" didn't change. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]