Hello,
The problem I met is the conflict between the default command /usr/bin/sometools , which is an very old version at system setup, and an updated one I have installed in $HOME/download-software/sometools
How do I tell a third program to use the customized sometools instead of the default one? This is related to my other question in this this post, again I do not have root privilege.
I have tried the alias in my ~/.bashrc by
alias sometools="$HOME/download-software/sometools"
but the program always uses the old version from /usr/bin/sometools . It seems related to login shell and non-login shell, non/interactive shell etc, but I am still not 100% sure after googling a while (I am not alone with this question!) and want to clarify this confusion here related to current problem. Thanks a lot!
The third program (this case is a PERL program) is what I called "soft calling" by:
$sometools_path=`which sometools`
I got lost with bunch of my alias and other export in my .bashrc .
May I ask in another way, does the third program use sometools by the first match or the last match in the $PATH from my .bashrc ?
Thank both of you!
Now I'm clear about the precedence of the $PATH in .bashrc for my sometools.
Put that aside, how is the $PATH related to the non/interactive shell and non/login shell. OK, the answer is related to the invoke order of the .bashrc, .profile, .bash_profile, which have to be understood.
1) First, when I start the terminal (regular way to click the terminal icon from the panel, Ubuntu/Mac OS), this is the interactive non login shell(it is bash), right?
2) Conceptually I understand login shell, but what is the example in regular use of terminal with login shell?
3) I started a terminal (as 1) above), then I started screen -S name1 , the shell within terminal name1 is an interactive non-login shell. Where is the login shell, or, has the login shell even been invoked?
Maybe I should start another thread.
Thank you again!