I am trying to read string into array using space as delimiter here I don't want to break down the spaces inside single quote or I can use double quote, if I use IFS='' (null), then all the words are getting read into first index but that's not purpose.
x="-r asdf -w test='foo ' "
IFS=' ' read -r -a y<<<$x
echo ${y[@]}
Output: -r asdf -w test='foo ' #Spaces are gone.
Thanks.