Search code examples
linuxpathsuse

Which not displaying location of executible actually run


I have a version of SVN on my system in /usr/bin/svn. This is too old to use with some repositories so I compiled a newer version in /home/user/built/bin/svn which works fine. I added this to my PATH so it should be run first.

Typing

which svn

produces

/home/user/built/bin/svn

however typing

svn --version

reveals that it us using the old version still. if I run

/home/user/built/bin/svn --version

then the correct version is displayed.

Since the custom version is first in my $PATH, and which lists it first why is the older version being invoked when I run svn? I thought which used your $PATH to find executables in the same fashion as the shell?


Solution

  • Use

    type svn
    

    to figure out (a) what it is, (b) where it is or what its definition is. Also check that PATH really contains what you think it does

    echo $PATH