开发者

Which not displaying location of executible actually run

开发者 https://www.devze.com 2023-02-03 04:46 出处:网络
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

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 shou开发者_运维百科ld 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?


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


Type gives:

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

Running

hash -r 

has now fixed the problem!

Credit to the OP


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

0

精彩评论

暂无评论...
验证码 换一张
取 消