From: Denis Ovsienko Date: Mon, 5 Jul 2021 13:28:34 +0000 (+0100) Subject: Address all shellcheck warnings in update-test.sh. X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/779ff621bccf205a00f9afa3c37865845871566a Address all shellcheck warnings in update-test.sh. --- diff --git a/update-test.sh b/update-test.sh index 6ee18cae..ad2c7eca 100755 --- a/update-test.sh +++ b/update-test.sh @@ -7,13 +7,15 @@ TZ=GMT0; export TZ for TEST in "$@"; do PREFIX=tests MATCH=0 - while read name input output options + while read -r name input output options do - [ _$name = _ ] && continue # ignore empty lines - [ _${name#\#} != _$name ] && continue # ignore comment lines - [ $name != "$TEST" ] && continue # not the requested test - [ _$output = _ ] && continue # ignore incomplete lines + [ -z "$name" ] && continue # ignore empty lines + [ "${name#\#}" != "$name" ] && continue # ignore comment lines + [ "$name" != "$TEST" ] && continue # not the requested test + [ -z "$output" ] && continue # ignore incomplete lines MATCH=1 + # Word splitting is intentional for $options. + # shellcheck disable=SC2086 ./tcpdump -# -n -r "$PREFIX/$input" $options >"$PREFIX/$output" done < $PREFIX/TESTLIST [ $MATCH = 0 ] && echo "test $TEST not found" >&2