From: Zhilong Liu Date: Mon, 28 Aug 2017 09:24:28 +0000 (+0800) Subject: mdadm/test: use the first element of array as parsing condition X-Git-Tag: mdadm-4.1-rc1~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3af7f2adc097fad519273a817c3ae6ac1f66d32f;p=thirdparty%2Fmdadm.git mdadm/test: use the first element of array as parsing condition it would complain "too many arguments" when array[] has few members, it's proper to check whether or not array[0] is null. Reported-by: Xiao Ni Signed-off-by: Zhilong Liu Signed-off-by: Jes Sorensen --- diff --git a/test b/test index 87e2df2d..25268a0f 100755 --- a/test +++ b/test @@ -75,7 +75,7 @@ save_log() { echo elif [ "$DEVTYPE" == 'loop' -o "$DEVTYPE" == 'disk' ] then - if [ ! -z ${array[@]} -a ${#array[@]} -ge 1 ] + if [ ! -z "$array" -a ${#array[@]} -ge 1 ] then md_disks=($($mdadm -D -Y ${array[@]} | grep "/dev/" | cut -d'=' -f2)) cat /proc/mdstat | grep -q "bitmap"