Hi,
Is there any way to convert a string into an array in KSH? In other words I want to split the string like this:
Code:
STRING="one two three four"
into an array of 4 values splitting on white space. The array should be similar to the one that would be created with the following command:
Code:
set -A STRING "one two three four"
Is there any way to do it in one instruction, not using a loop like this one:
Code:
i=0
for WORD in `echo ${STRING}`; do
STRING2[$i]=$WORD
((i=i+1))
done