From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Abbey To: cygwin@sourceware.cygnus.com Subject: Re: odd bash wrapping due to ansi codes Date: Mon, 18 Sep 2000 22:29:00 -0000 Message-id: <4.3.2.7.0.20000918233653.00e2b4e0@pop.bresnanlink.net> References: <20000918124010.21700.qmail@web117.yahoomail.com> X-SW-Source: 2000-09/msg00626.html At 05:40 9/18/00 -0700, Earnie Boyd wrote: >--- Chris Abbey 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@sourceware.cygnus.com