"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:03:51 +0100

Download raw body.

Thread
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?