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 Date: Sun, 22 May 2005 19:32:35 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: =?ISO-8859-15?Q?Sven_K=F6hler?= cc: cygwin AT cygwin DOT com Subject: Re: /etc/profile always does a "cd $HOME" In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-1116804755=:25809" ---559023410-1804928587-1116804755=:25809 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT On Sun, 22 May 2005, Sven Köhler wrote: > Hi, > > 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! > > IMHO, executing "bash -li" shouldn't change the workdir. > No other system i know does that. 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? Yes, you're correct in that on many Linux systems /etc/profile doesn't change the working directory. The directory is changed to $HOME by the login process. One possibility is adding a Cygwin-specific option to login(1) that would log in as the current user without requiring the username to be specified at the command line, to avoid local/domain username conflicts (e.g., "login -l") and skip printing the motd (as if .hushlogin is found). If I understand the security implications correctly, any user can log in as herself without a password (using, for example, "login -f"). Then cygwin.bat can be changed to use "login -lpf" instead of "bash -li". This would simplify scripts like 'chere'. It would also have the advantage of using the users' favorite shell from /etc/passwd in console logins. Now, . Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "The Sun will pass between the Earth and the Moon tonight for a total Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT ---559023410-1804928587-1116804755=:25809 Content-Type: text/plain; charset=us-ascii -- 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/ ---559023410-1804928587-1116804755=:25809--