I'm trying to convert a string variable into an array to iterate over the elements in Bash
This is my variable:
items="component01 component02 component03"
echo $items
>> component01 component02 component03
I tried with items=($items)
but when I check with echo ${#items[@]}
I get just one single element so I can't iterate over the elements with a for loop.
Also, I cannot make use of read -a
as I can't use it in macOS.