On 2015-10-28 09:14:05 +0000, Nicholas Bamber wrote: > This has been documented on the interwebs and in print as a Good Thing (TM). > http://docstore.mik.ua/orelly/unix3/korn/appb_08.htm To quote: > > > "Starting with ksh93m, the built-in arithmetic facility understands a large > percentage of the C language's expressions. This makes the shell more > attractive as a full-blown programming language. The following features are > available: > > .............. > > Octal and hexadecimal constants > You can use the C format for octal (base 8) and hexadecimal (base 16) > constants. Octal constants start with a leading 0, and hexadecimal constants > start with a leading 0x or 0X. For example: > $ print $((010 + 1)) Octal 10 is decimal 8 > 9 > "
Perhaps this should be reverted in ksh2020. Several languages have already moved away from the leading 0 prefix (generally replacing it with the unambiguous 0o or 0O prefix): D, ECMAScript, Python, TCL (and Perl 6, though that's a language different from Perl 5). -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)