Here is my bash script code
declare -a types=("m4.xlarge" "m5.12xlarge" "m5d.12xlarge" "m4.large" "m4.16xlarge" "t2.2xlarge" "c4.large" "c5.xlarge" "r4.2xlarge" "x1e.4xlarge" "h1.16xlarge" "i3.16xlarge" );
echo "array declared"
for i in {1..100}
do
for (( i=1; i<${arraylength}+1; i++ ))
do
#index=$( jot -r 1 0 $((${#expressions[@]} - 1)) )
randominstancetype=$[$RANDOM % ${#types[@]}];
#randominstancetype=$( shuf -i0-1 -n1 $((${#types[@]} )) );
#randominstancepvtiptype=$[$RANDOM % ${#pvtip[@]}];
#randominstancepubiptype=$[$RANDOM % ${#pubip[@]}];
done
done
I am trying to declare array and then print the elements inside the array randomly for around 100 times. Currently the name of the elements are not getting displayed instead it displays as 3 5 8 etc.. Anyhelp will be appreciated.