In HP Unix, I have a shell script called test.sh. In it, I have
echo $#
That is the only line in test.sh. Run the following in order,
> . test.sh a b
> 2
> . test.sh
> 2
> . test.sh a
> 1
> . test.sh
> 1
Weird. Anybody knows what is wrong? Is it a possible bug in HP/Unix? I think the shell needs to reset $# to 0 when no argument is passed.
Start Free Trial