--- In [email protected], Brett McCoy <idragos...@...> wrote: > > Most > shells provide a mechanism to find the location of an executable (bash > uses the 'which' command), but this may not be completely reliable as > someone could stick another version (maybe a hacked version) in a > different location that is earlier in the PATH than the real > executable.
But doesn't 'which' just do what the shell does when asked to execute a file ie. go through the directories in PATH looking for the specified file? In which case for the scenario you describe it would give the 'correct' result. However, it wouldn't work if the user had run an executable in a non-PATH directory with the same name as an executable in a PATH directory. Ready to be corrected...
