Interaction shell cmd prompt

hi ,

how do i interact with the shell prompt.
i need no. of args to be dynamic

e.g
$> type the no of args: <input from keyboard>
Enter the 1 st arg : <input from keyboard>
Enter the 2nd arg : <input from keyboard>
.........
.........

let me know how to do it ...

a=0
last="default"
while [ $last != "" ]; do 
    echo -n "Enter arg $a:" 
    read last
    eval set \$arg$a=$last
done

Now your arguments are $arg1 $arg2 $arg3 and so on.