X-Spam-Check-By: sourceware.org
Date: Thu, 12 Jan 2006 08:21:13 -0800
From: David Rothenberger <daveroth@acm.org>
Subject: Re: bash 3.1-1 "exec -l" doesn't start login shell
In-reply-to:  <011220060506.5714.43C5E3CA000C73CE0000165222064246130A050E040D0C079D0A@comcast.net>
To: cygwin@cygwin.com
Message-id: <43C681F9.5000506@acm.org>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 7bit
References:  <011220060506.5714.43C5E3CA000C73CE0000165222064246130A050E040D0C079D0A@comcast.net>
User-Agent: Thunderbird 1.5 (Windows/20051201)
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@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 1/11/2006 9:06 PM, Eric Blake wrote:
>> "exec -l" in bash 3.1-1 doesn't seem to start a login shell. This
>> prevents my chere commands from starting a login shell, too.
> 
> I couldn't reproduce the failure; can you provide more details?
> Here's what I tried:
> 
[snip program]
> 
> So exec -l is correctly prepending the '-' to argv[0].  Is you
> question about bash not behaving as a login shell when
> invoked with argv[0] set to "-bash"?  

I guess so.

> Have you tried "bash --login" instead?

"bash --login" works fine, but the problem with "-bash" prevents chere
from starting login shells. It may be possible to modify chere to use
"bash --login", but this is still a bash bug, right?

As I said, I noticed the problem first with chere. I confirmed the
problem by adding

    echo "`date` ~/.profile" >> /tmp/dotfile

at the top of ~/.profile. When I start a shell with "bash --login", I
see the current date/time added to /tmp/dotfile. If I execute "exec -l
/bin/bash", no entry is added to /tmp/dotfile with 3.1-1. An entry is
added with 3.0-14.

-- 
David Rothenberger                spammer? -> spam@daveroth.dyndns.org
GPG/PGP: 0x92D68FD8, DB7C 5146 1AB0 483A 9D27 DFBA FBB9 E328 92D6 8FD8

Your program is sick!  Shoot it and put it out of its memory.


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

