Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14322

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

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 16:57 -0400
Message-ID <mailman.3393.1531256229.1292.bug-bash@gnu.org> (permalink)
References (1 earlier) <c8ae5df2-b6b3-438f-bd99-4618f6b2d3c0@Spark> <71850c03-54d3-6a7e-1d29-136950d9e139@iki.fi> <a0b100e7-3e14-e56e-8ffb-fcaeca587bf1@case.edu> <CA+n9pTwOZNdmWqEYwE5cDohArgvZ285vSt-F=hw=ZGb8weO2qA@mail.gmail.com> <471822f3-4484-59b5-0433-fc394dc9b34a@case.edu>

Show all headers | View raw


Chet Ramey (<chet.ramey@case.edu>) wrote:

> On 7/10/18 2:48 PM, Isaac Marcos wrote:
> >     That is not an integer constant. Integer constants don't begin with
> `-'.
>

That makes negative numbers invalid.

This is not a serious argument.

Because of the difference between an operator and a constant. Unary plus
> and minus have a higher precedence than arithmetic operators. So if you
> expand the `a' to an expression, which is what happens, the expression
> consists of an operator (+ or -) and a constant, and that expression has
> a higher precedence than the +. You might think about why using `$a' in
> place of the `a' would not work all the time.
>


I don't care. All other shells do this correctly. It makes you the only one
wrong.

This is not a serious discussion.


-- 
Cases are always threesome:
Best case, Worst case, and Just in case

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Number with sign is read as octal despite a leading 10# Isaac Marcos <isaacmarcos100010@gmail.com> - 2018-07-10 16:57 -0400

csiph-web