Average of arguments

I have a program where the user enters numbers as arguments and it calculates the average, but it only works when i have a set amount of arguments that can be entered. How can i alter my script so that the user can enter as many arguments as he wishes?

You don't tell us which shell you are using. But in ksh, bash, and sh, $# is the number of arguments entered. To process an arbritary number of arguments, you typically loop checking $#. Inside the loop, you process $1. Then use use the command "shift". "shift" discards $1 and kinda moves the other args over. And it decrements $#.

Cheers, I got it workin fine now!