delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/09/19/01:30:32

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-Id: <4.3.2.7.0.20000918233653.00e2b4e0@pop.bresnanlink.net>
X-Sender: cabbey AT pop DOT bresnanlink DOT net
X-Mailer: QUALCOMM Windows Eudora Version 4.3.2
Date: Tue, 19 Sep 2000 00:29:00 -0500
To: cygwin AT sourceware DOT cygnus DOT com
From: Chris Abbey <cabbey AT bresnanlink DOT net>
Subject: Re: odd bash wrapping due to ansi codes
In-Reply-To: <20000918124010.21700.qmail@web117.yahoomail.com>
Mime-Version: 1.0

At 05:40 9/18/00 -0700, Earnie Boyd wrote:
>--- Chris Abbey <cabbey AT bresnanlink DOT net> wrote:
> > if [ "$SHELL" != "/bin/bash" ]; then
> >       test -f ./.profile && . ./.profile
> >       test -f ./.bashrc && . ./.bashrc
> > fi
> >
> > this has the advantage for those who run bash of not
> > sourcing these files twice, as bash does so itself.
>
>No, it doesn't always.  If --login then ./.bashrc is not performed but
>./.profile is, and without --login ./.bashrc is performed but not ./.profile.
>Also, without --login the /etc/profile isn't performed and shouldn't be a
>concern.

ok, my head hurts now. This explains why when I forget that the
cmd shell I'm in didn't start from bash that bash looks wierd when
I start it....

iow in bash.exe:
if (args.contains("--login")) {
     source = {"/etc/profile", "~/.profile"};
} else {
     source = "~/.bashrc";
}

ANYWAY... the circumstance I'm concerned with was the default bash
shell that comes up when the user clicks on that funky little Cygwin
icon on their desktop. So '--login -i' are the arguments; in which
case the pattern is:

/etc/profile sources ~/.profile
/etc/profile sources ~/.bashrc
bash sources ~/.profile

(I guess since I don't have a ~/.bashrc I never noticed it
wasn't being run twice. ;)

In which case I'd think the 'fi' element in my changed /etc/profile
can move up one line:

if [ "$SHELL" != "/bin/bash" ]; then
     test -f ./.profile && . ./.profile
fi
test -f ./.bashrc && . ./.bashrc


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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