[Intel-gfx] [PATCH i-g-t] igt_command_line.sh: Fix bashism

Petri Latvala petri.latvala at intel.com
Mon Sep 25 09:54:22 UTC 2017


[[ a != b ]] is a bashism. As it's just comparing $1 to an empty
string, use -n with a normal [ ].

/bin/sh is dash in CI.

Fixes: f0243a761f1b ("tests/igt_command_line.sh: Allow testing individual tests")
CC: Daniel Vetter <daniel.vetter at ffwll.ch>
Signed-off-by: Petri Latvala <petri.latvala at intel.com>
---
 tests/igt_command_line.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index 57d105e9..a8baaaa1 100755
--- a/tests/igt_command_line.sh
+++ b/tests/igt_command_line.sh
@@ -112,7 +112,7 @@ if [ $? -ne 0 ]; then
 	exit 99
 fi
 
-if [[ "$1" != "" ]] ; then
+if [ -n "$1" ] ; then
 	check_test $1
 	exit 0
 fi
-- 
2.14.1



More information about the Intel-gfx mailing list