From: Martin Schwenke Date: Mon, 5 Aug 2019 00:28:52 +0000 (+1000) Subject: ctdb-tests: Avoid shellcheck warning SC2045 X-Git-Tag: tdb-1.4.2~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1d36e94d2edbab89d7db5055b13689d94b128ad;p=thirdparty%2Fsamba.git ctdb-tests: Avoid shellcheck warning SC2045 SC2045 Iterating over ls output is fragile. Use globs. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh index e0e399ca9fa..27f9b1d1878 100755 --- a/ctdb/tests/run_tests.sh +++ b/ctdb/tests/run_tests.sh @@ -217,7 +217,11 @@ find_and_run_one_test () if [ -d "$f" ] ; then local i - for i in $(ls "${f%/}/"*".sh" 2>/dev/null) ; do + for i in "${f%/}/"*".sh" ; do + # Only happens if test removed (unlikely) or empty directory + if [ ! -f "$i" ] ; then + break + fi run_one_test "$i" if $exit_on_fail && [ $status -ne 0 ] ; then break