run script with ./ in front of name

on unix AIX5.3, we run a scripts by entering the
script name on the command line and sometimes
we get a not found error and then we put ./ in front on the name
and it runs.
Why? :confused:

check your '$PATH' environment variable - it probably doesn't have '.'

You can also try:

sh yourprog

but as VGERSH99 said, you should add that directory to the PATH variable.

rig,
when u run script by just entering the script name, the shell finds the script in paths/location as defined in the $PATH variable.

The reason why the script failed is because your current directory is not defined in the PATh varibale. But when you run script as ./script_name then the shell gets the location of the script as ' . ' ( i.e. yuor current directory )