Assigning values for a dynamic array for an input

Hello,
Can somebody please give me a snippet for the below requirement.

I want to assign the values separeted by a comma to be assigned to a dynamic array.
If I give an input (read statement) like abc1,abc2,abc3,abc4,abc5, all these strings abc* should be assigned to an array like below
export TEMP="abc1,abc2,abc3,abc4"
echo $TEMP_NODE | awk -F"," ' { arr[0]=$1 } { arr[1]=$2 } { arr[2]=$3 } { arr[3]=$4 }'

arr[0]=abc1
arr[1]=abc2
arr[2]=abc3
arr[3]=abc4

But If I give the input as abc1,abc2,.......,abc100, all these abc* strings should be assigned to an array of size 100. And if I give the input as abc1,abc2, it should assign the strings (abc1 and abc2) to an array of size 2.

With my little knowledge in Unix, I tried to get a solution by using different combinations cut,awk,sed. But I'm unable to get the desired result.:frowning:

Request the Unix gurus to help me with a small shell script (sh/bash) or some thoughts to achieve this requirement.

Thanks
~Suneel

Is this what you mean?

TEMP=abc1,abc2,abc3,abc4

echo $TEMP | nawk -F, '
{
        for ( i = 1; i <= NF; i++ )
                arr = $i
 }END{
        for ( i = 1; i <= NF; i++ )
                print arr
 }'

Output: -

abc1
abc2
abc3
abc4

Thanks steadyonabix. This worked for me upto certain level as I want to use that array in outside of the (n)awk block {}.

Meanwhile after struggling 3 hours I found another way as below.
read TEMP_NODE
echo ""
ARR_NODE=$(echo $TEMP_NODE | tr "," "\n")
for x in $ARR_NODE
do
echo "> [$x]"
done

Anyways thanks for the help.

Regards
~Suneel