From: "Dr. David Kirkby" <[EMAIL PROTECTED]>
[Much elided]
I believe that the test operator = is more portable than ==. If you're really after numeric equivalence, there's a -eq operator that I think is fairly portable. For what it's worth, == is also unrecognized on Mac OS X, which has a BSD lineage as well.dnl something here generates an error: dnl "test: ==: unexpected operator" on a Sun running NetBSD 1.6 if test $gsl_inc_count == 0 && test $gsl_lib_count == 0; then gsl_not_installed=1 elif test $gsl_inc_count != 2 || test $gsl_lib_count != 2; then gsl_incomplete=1 fi
A separate thing I noticed: if your variable gsl_inc_count is empty or undefined, test won't see it - its first argument will be your (intended) operator. For this reason, I always quote such variable arguments to test, if there's any chance they can be empty, e.g.,
if test "$gsl_inc_count" = 0 && ...
Historically, the really retentive thing to do is something like:
if test x"$gsl_inc_count" = x0 && ...
or, I suppose, for a numeric comparison this would work:
if test 0"$gsl_inc_count" -eq 0 && ...
Usually, though, I can't bear to write such grotesqueries.
- John Burger
The MITRE Corporation
