From 3921b80255f8f1a25ae64f75e1aa48d48780a87b Mon Sep 17 00:00:00 2001
From: Tommi Rantala <tt.rantala@gmail.com>
Date: Fri, 3 Jul 2009 15:31:47 +0300
Subject: [PATCH 16/25] fiu-ctrl: Fix bash array appending

Properly append items to the bash variable CMDS. The += syntax gave
error message under Bash 2.x, and did not actually append items to the
array under Bash 3.x either.

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
---
 utils/fiu-ctrl |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/utils/fiu-ctrl b/utils/fiu-ctrl
index 3683c23..a08e06d 100755
--- a/utils/fiu-ctrl
+++ b/utils/fiu-ctrl
@@ -67,9 +67,10 @@ function opts_reset() {
 function add_cmd() {
 	if [ "$NAME" != "" ]; then
 		if [ $PROB -ge 0 ]; then
-			CMDS+="enable_random $NAME $PROB $FAILNUM $FAILINFO"
+			C="enable_random $NAME $PROB $FAILNUM $FAILINFO"
+			CMDS[${#CMDS[*]}]="$C"
 		else
-			CMDS+="enable $NAME $FAILNUM $FAILINFO"
+			CMDS[${#CMDS[*]}]="enable $NAME $FAILNUM $FAILINFO"
 		fi
 		opts_reset;
 	fi
@@ -97,7 +98,7 @@ while getopts "+e:p:u:i:d:f:h" opt; do
 		FIFO_PREFIX="$OPTARG"
 		;;
 	d)
-		CMDS+="disable $OPTARG"
+		CMDS[${#CMDS[*]}]="disable $OPTARG"
 		opts_reset;
 		;;
 	h|*)
-- 
1.6.2.2.646.gb214

