Tokenising into array (KSH)

Greetings all,

I've been getting a little frustrated over my scripts as I'm not too experienced with powerful commands such as awk and sed. Hope to find some guidance here.

I need to extract the names of all directories within a specified directory, grab their names and then place each name as an entry in an array. Am pretty certain that this involves quite a bit of piping, though I'm not sure which commands + parameters to use to make the job much easier.

Hope to hear some suggestions from you all.

Thanks in advance.

set -A arr $(find ./* -type d -prune)

The anbu23' solution works fine for ksh.
With bash the syntax is different :

arr=( $(find ./* -type d -prune) )

In both case, you can access the data in the following way :

echo "Directories found : ${#arr[*]}
echo "Directories list :"
typeset -i i=0
while (( i < ${#arr} ))
do
    echo "[$i] ${arr[$i]}"
    (( i += 1 ))
done
set -- */

$1, $2 ...$n are the elements.

One learns something every day.
Thanks.

Thanks all!