Aliasing doesn't affect the which
command, for example:
$ which R
/usr/bin/R
$ alias R=/bin/date
$ R
Sun Jan 5 13:40:54 CET 2014 # as you see the alias works
$ which R # `which R` still returns the original path
/usr/bin/R
Instead of using aliases, I think you want to prepend /home/XXX/R-3.0.2/bin
to PATH
:
PATH="/home/XXX/R-3.0.2/bin:$PATH"
After this, if R
and Rscript
exist in /home/XXX/R-3.0.2/bin
, then:
which R
should return/home/XXX/R-3.0.2/bin/R
which Rscript
should return/home/XXX/R-3.0.2/bin/Rscript
as they will be found in /home/XXX/R-3.0.2/bin
first, before any other directory in the rest of $PATH
.