$# is the number of arguments passed.
For example, if myscript contains the line
then you'd get this:
Code:
myscript
0
myscript all
1
myscript all your
2
myscript all your base
3
myscript all your base are
4
You can use a test like this:
to exit if there are fewer than two arguments.