]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Avoid ShellCheck warnings SC2046, SC2005
authorMartin Schwenke <mschwenke@ddn.com>
Mon, 3 Jul 2023 01:54:15 +0000 (11:54 +1000)
committerMartin Schwenke <martins@samba.org>
Wed, 5 Jul 2023 11:18:37 +0000 (11:18 +0000)
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 <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
ctdb/tests/UNIT/eventscripts/scripts/local.sh

index e5d6ee502829cb6aec6983ad6d94fbb2c7772bb7..72c43bd7ee76e1fe2e67bc9c6553078a6a6fa538 100644 (file)
@@ -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()