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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:55

Ramsay Jones [off-list ref] 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.

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

From: Jon Seymour <hidden>
Date: 2016-06-15 22:53:55

On Sun, May 27, 2012 at 4:53 PM, Junio C Hamano [off-list ref] wrote:
Ramsay Jones [off-list ref] writes:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help