delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/03/01/12:35:44

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_THEBAT,KHOP_THREADED,SPF_SOFTFAIL,TW_TX
X-Spam-Check-By: sourceware.org
Date: Fri, 1 Mar 2013 21:25:08 +0400
From: Andrey Repin <anrdaemon AT freemail DOT ru>
Reply-To: Andrey Repin <cygwin AT cygwin DOT com>
Message-ID: <1667421808.20130301212508@mtu-net.ru>
To: "Chris J. Breisch" <chris DOT ml AT breisch DOT org>, cygwin AT cygwin DOT com
Subject: Re: startxwin started bash does not read .bashrc or .bash_profile
In-Reply-To: <5130D395.80601@breisch.org>
References: <15470 DOT 1361923720 AT relay DOT known DOT net> <512E489F DOT 8060700 AT dronecode DOT org DOT uk> <6514 DOT 1361987973 AT freon DOT franz DOT com> <1977176204 DOT 20130227233752 AT mtu-net DOT ru> <13227 DOT 1361996106 AT freon DOT franz DOT com> <CA+sc5mmn54WHcMp4Ycz7Lw8z9qe6aSvZ6GjU7JNo3fTcCxHg3w AT mail DOT gmail DOT com> <28423 DOT 1362003402 AT relay DOT known DOT net> <CA+sc5mkWtsLWV9ZMpnZZ3xFnRjUnJ_kQp6Di9_3a0F+M+5svZg AT mail DOT gmail DOT com> <22232 DOT 1362061704 AT relay DOT known DOT net> <CA+sc5mmFfRdcByF=w9XBdfx66Yt1+Y9sa30ZTEQc-Hbmh90AuA AT mail DOT gmail DOT com> <15096 DOT 1362152982 AT freon DOT franz DOT com> <5130D395 DOT 80601 AT breisch DOT org>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Greetings, Chris J. Breisch!

> On 3/1/2013 10:49 AM, Kevin Layer wrote:
>>
>> Don't have cron running.  I start it as me, the logged in user, from a
>> mouse click or running "startxwin" in a mintty.  Behaves the same
>> either way.

> Well, I am unable to duplicate this no matter what I do. I have even 
> launched a dash shell directly from cmd.exe and done a startxwin from that.

> I do have the following additions at the beginning of my .bashrc and 
> .bash_profile

> .bashrc:

> [[ "$-" != *i* ]] && return
> export BASHRC=${HOME}/.bashrc
> if [ "${BASH_PROFILE-unset}" = "unset" ]; then
>      source ${HOME}/.bash_profile
> fi

That's a weird way of doing this, if you ask me...
Normally (or, "in the Linux distributions I've been able to check"), .profile
sourcing the .bashrc.
The solution would be to launch bash with --rcfile=~/.profile

> .bash_profile:
> export BASH_PROFILE=${HOME}/.bash_profile
> if [ -f "${HOME}/.bashrc" ] ; then
>    if [ "${BASHRC-unset}" = "unset" ]; then
>      source "${HOME}/.bashrc"
>    fi
> fi

This is even weirder way of doing things.

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

Naturally, if you start with --rcfile set to .profile, your normal rcfile will
still be included.

> That's a little bit of overkill, but it ensures that both my 
> .bash_profile and .bashrc are sourced if I am in an interactive shell.

I'm unsure of the origin of this mess, but it's really should not be an issue.
Probably need to investigate whole chain, that leading to the bash being
started without .profile being run at least once in the meantime.

> For consistency, I should do a check for existence of the .bash_profile 
> before I source it in the .bashrc, just as I do with the .bashrc in 
> .bash_profile. But from a purist standpoint that's hardly the only thing 
> I'm doing wrong here.

> I do not have an .xinitrc. I do have an .Xdefaults, but it just has some 
> xterm display stuff in it.


--
WBR,
Andrey Repin (anrdaemon AT freemail DOT ru) 01.03.2013, <21:19>

Sorry for my terrible english...


--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019