[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Number with sign is read as octal despite a leading 10#
From: |
Isaac Marcos |
Subject: |
Number with sign is read as octal despite a leading 10# |
Date: |
Mon, 9 Jul 2018 21:24:37 -0400 |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR
uname output: Linux IO 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1
(2018-05-07) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 4.4
Patch Level: 12
Release Status: release
Description:
A value inside an arithmetic expansion is processed as octal despite using
a 10# preffix.
Repeat-By:
$ echo $((10#+0034))
28
Fix:
Extract optional sign before parsing the number, re-attach after.
--
Cases are always threesome:
Best case, Worst case, and Just in case
- Number with sign is read as octal despite a leading 10#,
Isaac Marcos <=
- Re: Number with sign is read as octal despite a leading 10#, Clint Hepner, 2018/07/09
- Re: Number with sign is read as octal despite a leading 10#, Ilkka Virta, 2018/07/10
- Re: Number with sign is read as octal despite a leading 10#, Ilkka Virta, 2018/07/10
- Re: Number with sign is read as octal despite a leading 10#, Chet Ramey, 2018/07/10
- Re: Number with sign is read as octal despite a leading 10#, Ilkka Virta, 2018/07/10
- Message not available
- Message not available
- Re: Number with sign is read as octal despite a leading 10#, Isaac Marcos, 2018/07/10
- Re: Number with sign is read as octal despite a leading 10#, Eduardo Bustamante, 2018/07/10
- Re: Number with sign is read as octal despite a leading 10#, Isaac Marcos, 2018/07/10
- Re: Number with sign is read as octal despite a leading 10#, Isaac Marcos, 2018/07/10
- Re: Number with sign is read as octal despite a leading 10#, Chet Ramey, 2018/07/10