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


Groups > gnu.bash.bug > #15588 > unrolled thread

Re: bug in arithmetic expansion

Started byRobert Elz <kre@munnari.OZ.AU>
First post2019-11-10 00:14 +0700
Last post2019-11-10 00:14 +0700
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: bug in arithmetic expansion Robert Elz <kre@munnari.OZ.AU> - 2019-11-10 00:14 +0700

#15588 — Re: bug in arithmetic expansion

FromRobert Elz <kre@munnari.OZ.AU>
Date2019-11-10 00:14 +0700
SubjectRe: bug in arithmetic expansion
Message-ID<mailman.1124.1573319700.13325.bug-bash@gnu.org>
    Date:        Sat, 9 Nov 2019 16:39:52 +0100
    From:        Davide Brini <dave_br@gmx.com>
    Message-ID:  <1MI5UD-1ifIp305PL-00FFhG@mail.gmx.com>

  | If you want to force base 10 interpretation (remember that leading 0 mean
  | octal in arithmetic context), you need to explicitly tell bash:
  |
  | $ echo $(( 10#0123 ))
  | 123

But do remember that that form is not portable, and is difficult to
use correctly in the cases that matter (when the actyal number comes
from a variable .. when it is literal, as in all the examples in this
thread, simply omitting the leading 0 is much simpler, and fully portable).

kre


[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web