This is the mail archive of the
mailing list for the Cygwin project.
Re: .bashrc file not run
On 11.02.2010 15:55, Neil Blue wrote:
Hello,Me too, a while ago.
This problem has me stumped.
By design (and documentation), bash runs *only* .profile (and
/etc/profile) if started as a "login shell".
When I login, the environment settings I put in .bashrc don't get run.
If I source ~/.bashrc they are included as expected.
Also I have added some configuration to /etc/bash.bashrc it does not get run.
It runs .bashrc (and /etc/...) only if *not* started as a login shell.
You may be used to different behaviour because on typical Linux systems,
~/.bashrc (and /etc/...) is called from /etc/profile.
The personal remedy is to call ~/.bashrc from ~/.profile.
In order to keep a portable .profile, it's a good idea to guard that
with some variable you set in .bashrc (e.g. $_HOMEBASHRC as on SUSE Linux),
so it's not called twice on Linux.
I don't know whether all Linux distributions do that in /etc/profile;
if so, following the general approach to increase compatibility with
Linux, would it be a good idea to consider it for cygwin too?
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple