X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 	tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <4B741CEB.6070706@towo.net>
Date: Thu, 11 Feb 2010 16:06:19 +0100
From: Thomas Wolff <towo@towo.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: .bashrc file not run
References: <244882.68384.qm@web34508.mail.mud.yahoo.com>
In-Reply-To: <244882.68384.qm@web34508.mail.mud.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 11.02.2010 15:55, Neil Blue wrote:
> Hello,
>
> 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?

Thomas

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

