diff options
author | Denis Ovsienko <denis@ovsienko.info> | 2021-07-05 14:28:34 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2023-01-03 12:46:07 +0100 |
commit | f2c57a8dad7dd6becce51c83eb5795f0610df1f2 (patch) | |
tree | bd32365d9431d5b8cc3fb86f43de6b377d45e399 | |
parent | 82fc6072e98be35a72208ad32751848a2eb8c8fc (diff) | |
download | tcpdump-f2c57a8dad7dd6becce51c83eb5795f0610df1f2.tar.gz |
Address all shellcheck warnings in update-test.sh.
(cherry picked from commit 779ff621bccf205a00f9afa3c37865845871566a)
-rwxr-xr-x | update-test.sh | 12 |
1 files changed, 7 insertions, 5 deletions
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 |