(no title)
fratajcz | 5 years ago
The example given for arithmetic expansion also uses x=$(($x-1)): https://pubs.opengroup.org/onlinepubs/007904875/utilities/xc...
fratajcz | 5 years ago
The example given for arithmetic expansion also uses x=$(($x-1)): https://pubs.opengroup.org/onlinepubs/007904875/utilities/xc...
emmelaich|5 years ago
The update 2017 standard mentions ((..)) but not in the obvious place. It's under 'compound commands/grouping' ...
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V...
> If a character sequence beginning with "((" would be parsed by the shell as an arithmetic expansion if preceded by a '$', shells which implement an extension whereby "((expression))" is evaluated as an arithmetic expression may treat the "((" as introducing as an arithmetic evaluation instead of a grouping command. A conforming application shall ensure that it separates the two leading '(' characters with white space to prevent the shell from performing an arithmetic evaluation.
Crestwave|5 years ago