delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/23/00:50:24

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
To: cygwin AT cygwin DOT com
From: =?ISO-8859-15?Q?Sven_K=F6hler?= <skoehler AT upb DOT de>
Subject: Re: /etc/profile always does a "cd $HOME"
Date: Mon, 23 May 2005 06:46:41 +0200
Lines: 41
Message-ID: <42916031.4060706@upb.de>
References: <d6qm36$var$1 AT sea DOT gmane DOT org> <d6qssc$vhm$1 AT sea DOT gmane DOT org>
Mime-Version: 1.0
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
In-Reply-To: <d6qssc$vhm$1@sea.gmane.org>
X-IsSubscribed: yes

>>i'd like to use cygwin from a normal windows-app. The problem is, that i
>>need a login-shell, so that all environment-vars are properly set. The
>>problem: bash -li always changes the current workdir!
> 
> That's not a problem, it's a feature.
> 
>>IMHO, executing "bash -li" shouldn't change the workdir.
> 
> Wrong!
> 
>>No other system i know does that.
> 
> Not true, "bash -li" works the same in any system that runs bash.  You are
> probably thinking of running "bash" without the parameter... that execution
> doesn't change the current location.
> 
> In fact, if you login into any system using any shell you login into your home
> dir.  That's the idea that the -l or --login parameter make explicit.

On any Linux-system i know, bash is already started in the homedir of
the user, and /etc/profile does not include any cd-command. Read Igor's
reply, he got the point.

>>Script may rely on that behaviour.
>>
>>/etc/profile contains the like
>>  cd "$HOME"
>>
>>That line cannot easily be removed. Starting the Cygwin-Link installed
>>by the setup wouldn't cd to ~ anymore. This behaviours is liked by most
>>users i guess (including my own).
>>
>>Any suggestions, how the situation could be improved?
> 
> Yep, read the bash manual, learn to use bash.
> 
> [Quote from man bash]

That quote didn't say anything about the current workdir. It just said,
that /etc/profile is executed. So the question still is, if it is legal
to have cd "$HOME" in there.


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