On Sat, Sep 25, 2010 at 17:08, Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxx> wrote: > Junio C Hamano wrote: >> POSIX wants shells to support both "N" and "$N" and requires them to yield >> the same answer to $((N)) and $(($N)), but we should aim for portability >> in a case like this, especially when the price we pay to do so is so >> small, i.e. a few extra dollars. > > Indeed > >> By the way, on my box, I get this: >> >>   $ ls l /bin/dash >>   -rwxr-xr-x 1 root root 104024 2008-08-26 02:36 /bin/dash* >>   $ dpkg -l dash | grep '^ii' >>   ii Âdash       Â0.5.4-12     ÂPOSIX-compliant shell >>   $ /bin/dash -c 'N=20 ; echo $(( N + 3 ))' >>   23 > > Ah, yes, I should have checked for this... particularly since I now > vaguely remember reading that this had been "fixed"... *blush* > Sorry about that. > > For the record, on my system I get: > >  Â$ ls -l /bin/dash >  Â-rwxr-xr-x 1 root root 80500 2007-03-05 06:00 /bin/dash* >  Â$ dpkg -l dash | grep '^ii' >  Âii Âdash      0.5.3-5ubuntu2 The Debian Almquist Shell >  Â$ /bin/dash -c 'N=20; echo $(( N + 3 ))' >  Â/bin/dash: arith: syntax error: " N + 3 " > >> I just left it vague by saying "e.g. older dash" in below, but we may want >> to be more precise in the documentation. > > I found a bug report: > >  Âhttp://bugs.launchpad.net/ubuntu/+source/dash/+bug/92189 > > which had a post against it which implied that this was fixed in > version 0.5.4-3. I went over to packages.debian.org to read the > ChangeLog for this version, but I could not conclude anything > from that text. :( > > Do we need to be more precise? If you want to spend the effort to track it down that would be great. There's a dash git repository on kernel.org you can probably bisect: http://git.kernel.org/?p=utils/dash/dash.git;a=summary -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html