[KLUG Members] why need executable absolute path?

Robert G. Brown members@kalamazoolinux.org
Sat, 03 Aug 2002 17:38:47 -0400


 bill <bill@billtron.com> wrote:
>While in a subdirectory, I can type
>vi somefile
>It will open because the file (somefile) is in the current directory.  But, if
>the file is executable, I can't type
>somefile
>I have to type
>/home/somedir/somefile
>Why is that?
Actually, you can type ./somefile if the executable is in your current
working directory.

The reason for this is that the current woking directory may not be in your 
PATH; most UNIX systems ship with the currect working directory in the PATH. 
If you want to put it there, it is fairly easy to do so...
export PATH=$PATH:./  

If you want this to apply to a particular user, you can put this kind of 
statement in the .bash_profile script, which runs when the user signs on.
Since (on Red Hat, at least, probably most others), the .bash_profile script 
already exports the PATH, only the statement:
PATH=$PATH:./

will be needed.
							Regards,
							---> RGB <---