2007-05-24 01:38:07

by Mike Frysinger

[permalink] [raw]
Subject: [patch] use POSIX equality test in check-lxdialog.sh

The "==" operator is not in POSIX, so use -eq instead.

Signed-off-by: Mike Frysinger <[email protected]>
---
index cdca738..9681476 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -51,7 +51,7 @@ usage() {
printf "Usage: $0 [-check compiler options|-header|-library]\n"
}

-if [ $# == 0 ]; then
+if [ $# -eq 0 ]; then
usage
exit 1
fi


2007-05-24 15:54:57

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [patch] use POSIX equality test in check-lxdialog.sh


On May 23 2007 21:37, Mike Frysinger wrote:

>The "==" operator is not in POSIX, so use -eq instead.

Apart from that, == is for strings, -eq is for numbers,
so that wrong variable content can be caught
("$x" -eq 123 where x=123foo throws an error).

So yes, the patch is good.

Jan
--