[TUHS] Arithmetic expansion in Unix shells

Chet Ramey chet.ramey at case.edu
Tue Jun 22 00:48:18 AEST 2021


On 6/21/21 10:43 AM, Michael Siegel wrote:
> Am Mon, 21 Jun 2021 09:50:38 -0400
> schrieb Chet Ramey <chet.ramey at case.edu>:
> 
>> The $((...)) form of arithmetic expansion is something POSIX picked up
>> from ksh-88, eventually. The early drafts of the standard (through
>> 1003.2 d9, at least), used $[...], but they eventually adopted
>> $((...)) because ksh-88 had already implemented it, though it's not
>> documented in Bolsky and Korn.
> 
> So, in other words, POSIX shell (meaning the shell described in the
> standard as it has been released) had double-parentheses arithmetic
> evaluation from the start?

 From the first published version of the standard, yes.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet at case.edu    http://tiswww.cwru.edu/~chet/


More information about the TUHS mailing list