ss="abcdefghi"
my_array=( `echo $ss | grep -o . ` )
### without for loops ###########
declare -a NewArray=("${my_array[@]}")
echo ${NewArray[@]}
########### using a for loop #################
for i in "${my_array[@]}"
do
new_array+=($i)
done
for i in "${new_array[@]}"
do
echo $i
done
#create array: or for int.. myArray=(1 2 3 4 5)
declare -a myArray=("cat" "dog" "mouse" "frog")
#to copy array instead of referencing aka array.slice(0)
declare -a myNewArray=("${myArray[@]}")
#slice array: returns ("cat" "dog")
declare -a myFirstHalf=( "${array[@]:0:2}" )