[Bug 932067] Re: Minus associativity not correct in arithmetic expansions

Jilles Tjoelker 932067 at bugs.launchpad.net
Fri Feb 17 22:16:38 UTC 2012


This was fixed between dash 0.5.5 and 0.5.6 by

commit 9655c1ac5646bde1007ecba7c6271d3aa98f294b
Date:   Tue Mar 9 12:52:30 2010 +0800

[ARITH] Fix binary operator parsing

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dash in Ubuntu.
https://bugs.launchpad.net/bugs/932067

Title:
  Minus associativity not correct in arithmetic expansions

Status in “dash” package in Ubuntu:
  New

Bug description:
  It seems that arithmetic expansion is completely broken in dash
  0.5.51-3ubuntu2 from 10.04.3 LTS:

  % /bin/sh -c 'echo $((10-2-3))'              # ok so far
  5
  % /bin/sh -c 'echo $((10-2*0-3))'         # what??
  13
  % /bin/sh -c 'echo $((10-2*1-3))'        # it's not limited to factor being 0 neither
  11

  This can be worked around by using additional parentheses, e.g.

  % /bin/sh -c 'echo $(((10-2*1)-3))'
  5

  FWIW the bug doesn't exist in dash 0.5.7-2 from Debian but I can't
  find any mention of it being fixed in dash change log so I'm not sure
  whether it's a dash bug or something Ubuntu-specific.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dash/+bug/932067/+subscriptions




More information about the foundations-bugs mailing list