Bugzilla – Bug 222
Bashisms in nsdc
Last modified: 2009-01-05 12:39:24 CET
This was pointed out by Lew Payne on the nsd-users mailing list.
There are several instances in nsdc where this syntax is used:
if test "something" == "$somevar"; then
== isn't the correct string equality operator for test and only works under shells like bash. The GNU coreutils version of test also flags this syntax as an error. The operator = should be used instead.
jd:~$ /usr/bin/test "this" == "that" ; echo $?
/usr/bin/test: ==: binary operator expected
jd:~$ /usr/bin/test "this" = "that" ; echo $?
This breaks nsdc "update" and "notify" on FreeBSD where the standard /bin/sh doesn't use the bash builtin for test.
fixed in trunk 2830. Will be in the next release. Thanks for submitting!
I mean r2831