I have two copies of svn
on my machine.
/usr/local/bin/svn
/opt/subversion/bin
When I run which svn
it states the first is running how can I switch it to the second?
I have two copies of svn
on my machine.
/usr/local/bin/svn
/opt/subversion/bin
When I run which svn
it states the first is running how can I switch it to the second?
Either create an alias to it in your shell, or put its directory ahead of the other in $PATH
.
If you want to switch between them on the fly, without changing your $PATH
, here's a little pattern I have used over the years, after seeing a coworker use this to good effect. I assume you have a $HOME/bin
already, really early in your $PATH
. Create the following shell script there,
#/bin/sh
PATH="/usr/local/bin:$PATH" export PATH
exec ${1+"$@"}
called, for example "local". Then you would invoke the version of svn in /usr/local/bin with the call:
$ local svn {whatever other arguments you need}
and just calling svn
without this wrapper script will find whatever one is first on your $PATH
.