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

Re: [PATCH] t7403-*.sh: Avoid use of the nonportable '==' operator

From
Jon Seymour <jon.seymour@gmail.com>
Date
May 27, 2012, 07:01 UTC
Message-ID
<CAH3AnrrbsQYvwUuEEwb-E7sV_odGPE7pEFXNZd+SbbGs+1-vLQ@mail.gmail.com>
In-Reply-To
<7vfwamp11u.fsf@alter.siamese.dyndns.org>
On Sun, May 27, 2012 at 4:53 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
>
>> Some shells, including dash, do not support using the '==' string
>> equality operator. This results in the failure of tests 7-12 with
>> 'test' complaining of an "unexpected operator".
>
> Thanks.  You do not have to single-out dash.
> A shell script that uses "test $a == $b" is *buggy* and not conforming to
> POSIX.

Yep. This slipped through because I happen to have reconfigured my /bin/sh to point to bash (frrom Ubuntu's default of dash) because of an issue with a product installation script. This shouldn't have been a problem if bash's POSIX mode was strict about rejecting == but bash doesn't seem to be strict about this.

Anyway, I have reverted /bin/sh to refer to dash so hopefully I won't be caught by this in future.

jon.
Previous: Junio C Hamano
Message 4 of 4 in “t7403-*.sh: Avoid use of the nonportable '==' operator”
  1. t7403-*.sh: Avoid use of the nonportable '==' operatorRamsay Jones, May 26, 2012
  2. Jon SeymourMay 26, 2012
  3. Junio C HamanoMay 27, 2012
  4. Jon SeymourMay 27, 2012

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.