"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: patch.sh: use test = op. instead of ==
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Tue, 8 Mar 2022 10:21:43 +0100

Download raw body.

Thread
On Tue, Mar 08, 2022 at 10:17:48AM +0100, Omar Polo wrote:
> Theo Buehler <tb@theobuehler.org> wrote:
> > On Tue, Mar 08, 2022 at 09:49:22AM +0100, Omar Polo wrote:
> > > as per subject; i've used == when i really wanted to use just one =
> > 
> > [..]
> > 
> > >  	ret=$?
> > > -	if [ $ret == 0 ]; then # should fail
> > > +	if [ $ret = 0 ]; then # should fail
> > 
> > Since you're comparing integers, shouldn't you be using -eq and -ne,
> > respectively?
> 
> yes, -eq and -ne are the correct things to use.  i went with = and !=
> only because that's what the rest of the regress suite uses.  (it's
> usually spelled [ "$ret" != "0" ] but i dropped the extra quoting.)
> 
> updated diff with -ne and -eq

ok