Which not displaying location of executible actually run.

Posted by Nick on Stack Overflow See other posts from Stack Overflow or by Nick
Published on 2011-01-05T16:29:52Z Indexed on 2011/01/05 16:54 UTC
Read the original article Hit count: 172

Filed under:
|
|
|

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?

[Edit] Type gives:

type svn
svn is hashed (/usr/bin/svn)

Is this the problem?

© Stack Overflow or respective owner

Related posts about linux

Related posts about path