From: Martin Schwenke Date: Mon, 3 Jul 2023 01:54:15 +0000 (+1000) Subject: ctdb-tests: Avoid ShellCheck warnings SC2046, SC2005 X-Git-Tag: talloc-2.4.1~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58a117d3d57de416b946c91bf78107d507616e63;p=thirdparty%2Fsamba.git ctdb-tests: Avoid ShellCheck warnings SC2046, SC2005 In ./tests/UNIT/eventscripts/scripts/local.sh line 328: echo $(ctdb ifaces -X | awk -F'|' 'FNR > 1 {print $2}') ^-- SC2046 (warning): Quote this to prevent word splitting. ^-- SC2005 (style): Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. Use xargs to get output on 1 line. Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider --- diff --git a/ctdb/tests/UNIT/eventscripts/scripts/local.sh b/ctdb/tests/UNIT/eventscripts/scripts/local.sh index e5d6ee50282..72c43bd7ee7 100644 --- a/ctdb/tests/UNIT/eventscripts/scripts/local.sh +++ b/ctdb/tests/UNIT/eventscripts/scripts/local.sh @@ -319,8 +319,7 @@ ctdb_set_pnn() ctdb_get_interfaces() { - # The echo/subshell forces all the output onto 1 line. - echo $(ctdb ifaces -X | awk -F'|' 'FNR > 1 {print $2}') + ctdb ifaces -X | awk -F'|' 'FNR > 1 {print $2}' | xargs } ctdb_get_1_interface()