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_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()