git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re*: [PATCH] t1503: Fix arithmetic expansion syntax error when using dash

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2010, 17:58 UTC
Message-ID
<7vbp7logcg.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4C9E2CA6.2070805@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 45 quoted lines
> 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?
>
> Should I re-work the commit message and re-submit?

I don't think so; we now know that dash 0.5.3 or older may have this problem and that is clear enough for our purpose.

Thanks.
Previous: Ramsay Jones
Message 7 of 7 in “t1503: Fix arithmetic expansion syntax error when using dash”
  1. t1503: Fix arithmetic expansion syntax error when using dashRamsay Jones, Sep 21, 2010
  2. Re*: [PATCH] t1503: Fix arithmetic expansion syntax error when using dashJunio C Hamano, Sep 22, 2010
  3. Jon SeymourSep 22, 2010
  4. Ramsay JonesSep 25, 2010
  5. Ævar Arnfjörð BjarmasonSep 25, 2010
  6. Ramsay JonesSep 29, 2010
  7. Junio C HamanoSep 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.