Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14324
| From | Isaac Marcos <isaacmarcos100010@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: Number with sign is read as octal despite a leading 10# |
| Date | 2018-07-10 18:46 -0400 |
| Message-ID | <mailman.3402.1531262798.1292.bug-bash@gnu.org> (permalink) |
| References | (3 earlier) <a0b100e7-3e14-e56e-8ffb-fcaeca587bf1@case.edu> <CA+n9pTwOZNdmWqEYwE5cDohArgvZ285vSt-F=hw=ZGb8weO2qA@mail.gmail.com> <471822f3-4484-59b5-0433-fc394dc9b34a@case.edu> <CA+n9pTzNU4stJykWKAJkPzwwrkmxzirWmuUT_xA9U=ZWsh3nMQ@mail.gmail.com> <CAOSMAutyKDe7QqVHLQ_jFBzZ09hiOwz_LfkoCVYXpDGVNohm0Q@mail.gmail.com> |
2018-07-10 18:12 GMT-04:00 Eduardo Bustamante <dualbus@gmail.com>:
> On Tue, Jul 10, 2018 at 1:57 PM, Isaac Marcos
> <isaacmarcos100010@gmail.com> wrote:
> > Chet Ramey (<chet.ramey@case.edu>) wrote:
> [..]
> > This is not a serious argument.
> [...]
> > I don't care. All other shells do this correctly. It makes you the only
> one
> > wrong.
> >
> > This is not a serious discussion.
>
> Can you keep the discussion civil?
No.
> I don't get why you feel compelled
> to qualify an argument from the main developer as "non serious".
>
Because *he* qualified my comments as "non serious" in another email.
> What's your definition of "correct"?
Exactly what was posted on the fist post. That a `a=+0034; echo
"$((10#$a))"' print 34 not 28.
Try this(from some other e-mail I did send):
set -- 34 034 0034 +34 +034 +0034 -34 -034 -0034 ;
for i do printf '%6s' "$((10#$i))"; shift; done; echo
34 34 34 34 28 28 -34 -28 -28 #
bash
34 34 34 34 28 28 -34 -28 -28 #
posixbash
34 34 34 34 34 34 -34 -34 -34 #
lksh
34 34 34 34 34 34 -34 -34 -34 #
mksh
34 34 34 34 34 34 -34 -34 -34 #
ksh93
34 34 34 34 34 34 -34 -34 -34 #
attsh
34 34 34 34 34 34 -34 -34 -34 # zsh
Only bash prints 28. Why others can print 34 ?
According to Chet, the definition
> is the same as the ISO C standard. I'm not sure if there's a public
> version of the ISO C standard document, but
> http://c0x.coding-guidelines.com/6.4.4.1.html seems to be good enough.
> The definition of an "integer constant" in that document does not
> include a sign.
>
That is a description of the inability (or unwillingness) to raise above c
limitations.
What is odd in expecting that an string like `-00133` actually mean `-133`
in decimal?
Even more if the shell is explicitly told to parse the string as decimal
with the `10#'.
> So, in that regard, Bash is behaving according to specification.
>
As is also according to specification (of c) that a string could not have a
NUL byte but
some shells raise above that limit and are able to reasonably use such
values.
But I don't care anymore. This is the way in which users are lost, and you
have lost me.
I'll just use some other shell.
--
Cases are always threesome:
Best case, Worst case, and Just in case
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: Number with sign is read as octal despite a leading 10# Isaac Marcos <isaacmarcos100010@gmail.com> - 2018-07-10 18:46 -0400
csiph-web