????? HELP!!! what is wrong with this code? ???????
Doug Gwyn
gwyn at smoke.ARPA
Thu Oct 13 19:03:42 AEST 1988
In article <561 at micropen> steve at micropen (Steven J. Owens) writes:
> I always thought UNIX checked in the directory you are in first
> for the binary, then if it couldn't find it there, it checked
> the $PATH.
No -- the UNIX shell uses the specified pathname as is when it contains a
slash (/); otherwise it searches the directories specified as :-delimited
fields in the value of environment variable PATH, in order. If the
current directory is not in PATH, it will not be searched.
The two most usual ways to specify the current directory in PATH are
"." and "" (empty string). Some older shells will not interpret a
final empty string in PATH as the current directory, even though they
are supposed to (it's a bug, not a feature).
To deliberately run something from the current directory, you should
type ./command, which is independent of PATH. (It is not wise to have
the current directory early in the PATH directory list.)
More information about the Comp.unix.questions
mailing list