From 3af7f2adc097fad519273a817c3ae6ac1f66d32f Mon Sep 17 00:00:00 2001 From: Zhilong Liu Date: Mon, 28 Aug 2017 17:24:28 +0800 Subject: [PATCH] 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 --- test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test b/test index 87e2df2..25268a0 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"