[plug] Questions for information - Richard

James Elliott James.Elliott at wn.com.au
Sun May 5 14:35:26 WST 2002


On 05/05/2002 Richard wrote:

> More of a question in a similar vain than a response (hope you don't mind
> James :)...I was just wondering if anyone could tell me why sometimes a
> script or executable can be run simply by entering it's name (while in the
> same dir) and yet another has to have it's complete address to run (once
> again, even when in the same dir).

I can actually answer that one, Richard, because i have asked it myself, of
my tutor.

Firstly, I think in the second instance you mention, you will find it will
execute if you enter ./command and you don't need to enter the WHOLE path,
just the end of the relative path.

The reason the command will not execute even though yu are in the same
directory is because you do not have that directory in your
current search path.  If you type:

echo $PATH

It will display the directories in your path, separated by colons.  It
is normal not to have the current working directory (.) in your search
path for security reasons (to prevent you from accidentally executing
programs you didn't intend to).  A quicker way to run a program in your
current working directory that is not in your path is to type:

./listfiles

I hope that helps.

Kind regards,

James Elliott




More information about the plug mailing list