From: Martin Schwenke Date: Wed, 3 Jun 2020 23:59:59 +0000 (+1000) Subject: ctdb-tools: Improve onnode's ShellCheck credibility X-Git-Tag: talloc-2.3.2~1102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e287127cb8d8ce93abb99ea32b146b9392b56bc;p=thirdparty%2Fsamba.git ctdb-tools: Improve onnode's ShellCheck credibility Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Thu Jul 16 06:51:47 UTC 2020 on sn-devel-184 --- diff --git a/ctdb/tools/onnode b/ctdb/tools/onnode index a42ff393574..f2be62e5af4 100755 --- a/ctdb/tools/onnode +++ b/ctdb/tools/onnode @@ -154,7 +154,7 @@ get_nodes_with_status () ( local i IFS="${IFS}|" - while IFS="" read i ; do + while IFS="" read -r i ; do # Intentional word splitting # shellcheck disable=SC2086 @@ -193,7 +193,7 @@ get_any_available_node () # We do a recursive onnode to find which nodes are up and running. local out line out=$("$0" -pq all ctdb pnn 2>&1) - while read line ; do + while read -r line ; do if [[ "$line" =~ ^[0-9]+$ ]] ; then local pnn="$line" # Intentional multi-word expansion