Now I understand what you mean ok...
There is nothing to reset as shell scripts usually don't remember anything without writing it to a file or exporting it to the environment. So there is nothing to reset.
The problem with your script is the line
which you should try with
The double round brackets treat the values as numbers (arithmetic), not as strings, so it should work now.
Example:
Code:
root@isau02:/data/tmp/testfeld> cat script.ksh
#!/usr/bin/ksh
echo $#
if (( $# != 2 )); then
echo "Hey! This is not 2 parameters!"
else
echo "Everything is fine"
fi
exit 0
root@isau02:/data/tmp/testfeld> ./script.ksh b lala
2
Everything is fine
root@isau02:/data/tmp/testfeld> ./script.ksh b lala lal
3
Hey! This is not 2 parameters!
root@isau02:/data/tmp/testfeld> ./script.ksh yo
1
Hey! This is not 2 parameters!
EDIT: Oh didn't notice he was sourcing, forget my post 