i*****s 发帖数: 438 | 1 How to set up environment variables (PATH, etc) for
interactive and non-interactive sessions?
If I set PATH in .bash_profile, is it interactive
or non-interactive?
How many such files can affect the setting?
.profile? .bash_profile? .bashrc? .bash_login? what else?
When all of them are present, which one got to run first?
Which one should be used?
Thanks! | v*****r 发帖数: 1119 | 2 "Invoation" section of the man page of bash command specifies clearly under
what condition and sequence those files are invoked depending on whether it
is a login shell or interactive shell.
Regarding where to set Environment/Shell variables in Bash, I posted one
general guideline before:
1. Set all environment variables in .bash_profile (assuming bash is your
login shell. It will be .profile if you are ksh fan like me).
2. Set all shell variables to .bashrc.
3. As a general rule, always call .b | i*****s 发帖数: 438 | 3
under
whether it
one
your
should
Thank you for the advice, I noticed, however, after logging in GUI
interface of GNOME, when I click on the terminal icon,
LD_LIBRARY_PATH is not set. It will be set if ssh to the host.
【在 v*****r 的大作中提到】 : "Invoation" section of the man page of bash command specifies clearly under : what condition and sequence those files are invoked depending on whether it : is a login shell or interactive shell. : Regarding where to set Environment/Shell variables in Bash, I posted one : general guideline before: : 1. Set all environment variables in .bash_profile (assuming bash is your : login shell. It will be .profile if you are ksh fan like me). : 2. Set all shell variables to .bashrc. : 3. As a general rule, always call .b
|
|