[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number with sign is read as octal despite a leading 10#

From: Chet Ramey
Subject: Re: Number with sign is read as octal despite a leading 10#
Date: Tue, 10 Jul 2018 23:31:22 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.0

On 7/10/18 6:46 PM, Isaac Marcos wrote:
> 2018-07-10 18:12 GMT-04:00 Eduardo Bustamante <address@hidden
> <mailto:address@hidden>>:
>     On Tue, Jul 10, 2018 at 1:57 PM, Isaac Marcos
>     <address@hidden <mailto:address@hidden>> wrote:
>     > Chet Ramey (<address@hidden <mailto:address@hidden>>) 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.

I did. You wrote:

"Are you saying that bash should reject the use of negative numbers?
And, If so, why bash does not raise an error? (as it is expected that it
must do on invalid input)."

This is clearly a ridiculous strawman.

The topic is whether or not a sign can appear in the middle of an integer
constant, even when that integer constant begins with the `base#' syntax.

> Only bash prints 28. Why others can print 34 ?

They extend the definition of an integer constant. It's perfectly
reasonable to do that. Bash sticks to the C definition.

> What is odd in expecting that an string like `-00133` actually mean `-133`
> in decimal?

Why would that be reasonable? Integers beginning with `0' are octal

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]