delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/13/17:53:25

X-Spam-Check-By: sourceware.org
Message-ID: <20060113225308.18653.qmail@web53413.mail.yahoo.com>
Date: Fri, 13 Jan 2006 14:53:08 -0800 (PST)
From: Dave <d_inabox AT yahoo DOT com>
Subject: Re: bash 3.1-1 "exec -l" doesn't start login shell
To: cygwin AT cygwin DOT com
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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

David Rothenberger wrote:
> 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.
>>
>> 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?

chere could indeed be modified to do that. However prepending '-' is (currently)
the only method of invoking a login shell which works across all the packaged
shells.

So I went ahead and installed 3.1-1 to try it out. Here's what I found:

chere did indeed stop working as advertised. Further experiments from a command
prompt:

--- start
c:\cygwin\bin>bash
bash-3.1$ exec -l bash

d_inabox AT minime ~
$ 
--- end

login shell executed (PS1 evaluated). Attempting the verbatim line from chere:

--- start
c:\cygwin\bin>bash
bash-3.1$ exec -l /bin/bash
bash-3.1$
--- end

I haven't checked $0, but I'm guessing it's something like -/bin/bash, and this
isn't triggering a login shell.

chere passes the full path to the executable in case the shell isn't in the
path. I can't remember if this was absolutely necessary, but it certainly works
with the other shells. e.g

--start
c:\cygwin\bin>bash
bash-3.1$ exec -l /bin/zsh

(d_inabox AT minime)[1] ~
$
---end

Regards,

Dave
chere maintainer

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

- Raw text -


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