I'm trying to store a string with spaces into an array. I've used IFS="" and noticed that by doing this. my array_size is 1 although I have multiple strings. Is there a way to fix this?
the code i'm using
size=0
declare -a new
for t in ${temp};
do
new[size++]=$t
done;
for n in ${new[@]};
do
echo $n end
done;
my output is..
my string 1
my string 2
another string 3
another string 3 end
my desired output would like something like this..
my string 1 end
my string 2 end
another string 3 end