delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/17/11:32:29

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sun, 17 Aug 2008 11:31:47 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin.bat doesn't save original directory in OLDPWD after login
Message-ID: <20080817153147.GB5950@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1164057241 DOT 20080817165010 AT inbox DOT ru>
MIME-Version: 1.0
In-Reply-To: <1164057241.20080817165010@inbox.ru>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

On Sun, Aug 17, 2008 at 04:50:10PM +0400, Andry wrote:
>If run cygwin from cmd.exe from random directory, for example, from
>"c:\blablabla", then after login OLDPWD would be "/usr/bin" instead
>original directory.  So command cd "$OLDPWD" just after login restores
>wrong directory.  This is because batch file has been wroten
>incorrectly.  This is correct:
>
>"%~dp0bin\bash" --login -i

I don't see how that can be correct.  There seems to be some inexplicable
mangling in the above.

However, the cygwin.bat file isn't really intended to be the way you
"run cygwin" from everywhere.  If you want to run bash then run
c:\cygwin\bin\bash.  Add c:\cygwin\bin to your PATH and you won't even
have to type the path.  Just type "bash".

cgf

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