clear content in file.

cat /dev/null > filename

the number of parameters.

$#
more precisely, the number is for the parameters which are passed to script.
the number of parameters of shell script is different to the number of paramters for C programs. The difference is whether take care of the script name.
C：