Skip to contentSkip to conversation

test-suite: remove bashism to avoid test failures

PATCH In review Ramsay Jones 1 participant 1 message Oct 11, 2014 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 test-suite: remove bashism to avoid test failures

The use of the '==' operator in a test/[ conditional is a non-POSIX bash extension. In order to avoid test failures on systems that do not have bash as the system shell (/bin/sh), replace the use of the '==' operator with the POSIX compatible '=' operator.

---

Hi Chris,

Sorry for not spotting this earlier; I just looked at your patch in my email client and thought 'yep, that looks good', without actually testing the change. :(

Since Linux Mint is a Ubuntu derivative my /bin/sh is actually dash. (I hear Fedora are looking to change /bin/sh to dash as well. :-D ).

ATB,
Ramsay Jones

 validation/test-suite | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
validation/test-suite +1 -1
index 7f0f83e..df5a7c6 100755
@@ -114,7 +114,7 @@ do_test()
 	set -- $cmd
 	base_cmd=`basename $1`
 	for i in $disabled_cmds; do
-		if [ "$i" == "$base_cmd" ] ; then
+		if [ "$i" = "$base_cmd" ] ; then
 			disabled_tests=`expr $disabled_tests + 1`
 			echo "     DISABLE $test_name ($file)"
 			return 3
Signature · 1 line
2.1.0