Carl McNamee wrote:
> I am curious about something that I have been running into in the posix
> shell. Why do I have to qualify the name of a script to be run with "./"?
> If I have the script "test" in the directory "/SYS/CARL/" and I am in the
> CARL directory I have to run the test script by typing "./test". Why can't
> I just type "test" and have it run?
Check your PATH environment variable:
echo $PATH
If you want your script to run when you enter its unqualified name, your PATH
needs to contain either an entry for /SYS/CARL, or the current working
directory indicated by a single period (.) character.
Some people consider . in PATH to be a security risk because when you cd into a
new directory, and then try to run an unqualified command name, you may find
yourself surprised if that directory contains that command where somebody
implemented different functionality.
- Mark B.
PS: "test" is a bad choice for a file name because it conflicts with a shell
command called "test".