Don't know why it doesn't work. It works for me...
Are you sure the $# is the problem?
Usually I always quote the variables in my tests, even though it's not always necessary.
I just saves me some hassle whenever it does matter...
if [ "$#" -eq 1 ]; then
echo "you gave 1 argument"
You could test your script by executing it with 'bash -x ./scriptname' to see what really happens.