Subject: Re: test: ==: unexpected operator
To: None <tech-userlevel@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-userlevel
Date: 09/24/2006 18:01:54
In article <Pine.LNX.4.64.0609241902560.20837@m2s05.vlinux.de>,
Hubert Feyrer  <hubert@feyrer.de> wrote:
>On Fri, 22 Sep 2006, Hubert Feyrer wrote:
>> bash/Linux allows "==" as an alternative to "=" in their test(1) command.
>> I wonder if we want to save some trouble and just make our test(1) silently 
>> accept that too, instead of fixing all the broken scripts out there.
>>
>> It'd be an extension to POSIX, so I don't see much of a problem.
>>
>> Any thoughts?
>
>Apparently there were quite a number of them, and instead of addressing 
>eac of them I'd like to explain my motivation behind this change, after 
>the uproar and namecalling that I got:
>
>  * I see NetBSD as an operating system project, and for me an OS is
>    something to run software written not only from "NetBSD" but from
>    any user. If someone thinks '==' is preferably over/equivalent to '='
>    for test(1) I see no problem improving NetBSD's usability instead of
>    printing an error messagen. There's prior art in bash to handle '=='
>    which is used as /bin/sh on a majority of machines out there, so trying
>    to help the user seemed OK for me.
>  * The change was not intended to 'encourage' anyone to use the feature in
>    their own scripts. If discouragement of writing such could best
>    be reached by documentation, warnings or plain errors could be
>    discussed separately
>  * Whether or not this is described by POSIX has little meaning here,
>    given that NetBSD does not fulfull POSIX in many parts, and adds many
>    extensions in others.
>  * pkgsrc at least was founded as _NetBSD_s Packages Collection (by Al
>    and me), and while I find the argument cute that we should dumb down
>    NetBSD to detect errors for operating systems, I'd rather make work
>    for people porting software _to NetBSD_ easiler, thank you very much.
>  * Of course there's a big bunch of people out there that say that bash is
>    all wrong, offering non-"standard" behaviour. Guess what: I agree.
>    But: I'm not working on Bash, I'm not working on Linux, and I can't
>    improve all the Linux programmers and -wannabes out there that write
>    code that runs on bash. I encourage everyone to go out and educate
>    the programmers that use 'test ==', and maybe even get bash to behave
>    as much of a POSIX compliant shell as possible when called as /bin/sh.
>    Go, do it - but remember that this is work outside of NetBSD.
>  * The tone of voice a number of the people have used in this "discussion"
>    was quite a (negative) surprise to me. To say the least.
>
>In summary, I think little people in this "discussion" cared for the 
>actual goal of making NetBSD more usable here, but rather cared to
>voice their opinion on what random shell script writers / Linux 
>programmers, people that write documentation that tells using 'test 
>==' is ok and maybe even bash maintainers do.
>
>I have no desire to continue squabbling with the vocal majority here,
>and thus chose to back out the change.

I think that the response to your change was very harsh and instead
of having a constructive discussion on how this should be handled
the end result was that you ended up feeling bad, decided it was not
worth it, and backed it out. This is what is happening in many of
the technical discussions in these lists and it needs to stop.
Unfortunately the silent majority shows apathy when someone decides
to use his keyboard to enlarge his ego, instead of telling him to
stop and put him back into his place. Maybe creating a list of
people who abuse the lists and moderating them is not a bad idea.

Back to the technical issue. I think that accepting the == and
with a warning is better than failing. Perhaps even the warning
can be enabled/disabled via an environment variable? I don't think
though that the use of == should be encouraged, so accepting it
without a warning in the default case feels wrong to me. -- At
least until it becomes part of POSIX ;-)

christos