Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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?= 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: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) In-Reply-To: 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/