Splitting a string

Hi,

I am new to shell scripting, Can any body suggest me how I can split a string with a delimiter as whitespace into words and store into a array.

I have read a line from file, now I want to split the line into words and store in a array for further use.

eg : the sky is blue
want output(temp) as array like
${temp[0]} = the
${temp[1]} = sky
${temp[2]} = is
${temp[3]} = blue

Any suggestions please.

Regards,
smk

#!/bin/ksh
a="the sky is blue"
set -A myarray $a

in bash.

# v="the sky is blue"
# set -- $v
# echo $1
the
# echo $2
sky
# echo $3
is
# for items in "$@"
> do
> echo $items
> done
the
sky
is
blue


awk '{ for( i=1; i<=NF; i++ ) { arr[$i]++ } }' filename