Subject: Re: test: ==: unexpected operator
To: Hubert Feyrer <hubert@feyrer.de>
From: Klaus Klein <kleink@reziprozitaet.de>
List: tech-userlevel
Date: 09/24/2006 20:37:48
Hubert Feyrer 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.
Setting portability concerns and pkgsrc pains aside for a moment:
While there's prior art in the GNU/bash world for this, given the C
ancestry of the == operator (as you portrayed it) it's not all that
obvious that it's meant to be a synonym for =, as opposed to -eq.
That's what's bothering me substiantially about supporting this
"design".
- Klaus