execute

can someone tell me what is the difference between . and ./ in a script

. is used to execute something without forking - i.e in the current environment (I'm sure someone else could give you a better explanation if that's not technically accurate).

./ is used to mean something in the current directory. You would use this to run something in the current directory, if that directory (either fully qualified, or .) is not in your path

I was wondering when you log on to a unix box how does unix know what the default shell type is, C shell, borne shell, korn shell. My understanding is it executes different login scripts depending what the default is . Could this have any impace on why I need to use ./ instead of .

I have included :. in /etc/profile but it has not corrected the problem. Any other suggestion most welcomed.

Thank to all who have replied.

/etc/passwd determines the login shell.
Did you logout/login or source your profile changes when testing?

echo $PATH

if it looks something like this, especially the first two characters

echo $PATH
.:/usr/bin:/usr/sbin

What you want (no leading ./) definitely should work for you. And, of course, the scripts in question - the ones in your directory - have execute permissions set.