View Single Post
  #5 (permalink)  
Old 30-Jun-2009, 13:49
hcvv's Avatar
hcvv hcvv is online now
Wise Penguin
 
Join Date: Jun 2008
Location: Netherlands
Posts: 1,913
hcvv 's reputation will be famous soon enoughhcvv 's reputation will be famous soon enoughhcvv 's reputation will be famous soon enough
Default Re: Relative pathname for executable file

You are correct but one detail.

It is not required to type an absolute path, it may be relative. In fact ./ is relative (it does not start with /).

But you are correct, when you do not provide a path yourself, the shell will look at your PATH environment variable and search from left to right in all the directories until it finds a file of the name you gave and then try to execute it.

And it is the inclusion of relative pathes in the PATH variable (and ./ is the most (mis)used one here) that can create havoc because it depends upon what your working directory is at the very moment you call something where it will end up somewhere relative to that working directory.
__________________
Henk van Velden
Reply With Quote