Question

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)

Using

hash -r

Has now fixed the problem! Thanks for the help. :)

Was it helpful?

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

OTHER TIPS

You sure you don't have a symbolic link to svn somewhere else in your path?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top