This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: .bashrc file not run

On 11.02.2010 15:55, Neil Blue wrote:

This problem has me stumped.
Me too, a while ago.

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.
By design (and documentation), bash runs *only* .profile (and /etc/profile) if started as a "login shell".
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:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]