delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/11/22:50:18

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
Message-ID: <4143B935.5020305@yahoo.com>
Date: Sun, 12 Sep 2004 11:49:25 +0900
From: Aaron Stephanic <yakei410 AT yahoo DOT com>
User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040830)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: "cd" in bash script not being executed
References: <41427468 DOT 8010203 AT yahoo DOT com> <472287831 DOT 20040911110807 AT Menschel DOT net>
In-Reply-To: <472287831.20040911110807@Menschel.net>
X-Virus-Scanned: by amavisd-new at cs.kent.edu

Sorry, it was my understanding of scripting that was broken.  My script 
wasn't permanently changing directories so I thought "cd" wasn't 
working.  But amazingly enough you actually can't permanently change 
directories in a script without a workaround... you have to "source" the 
script instead of execute it, or something along those lines... the 
reason being that scripts execute as child processes and can't change 
the directory of their parent process.  See this thread:
http://archive.lug.boulder.co.us/bymonth/1998.12/msg00151.html

That thread has a very interesting discussion of "cd" and even a 
suggestion on how to get rid of the need to type the command altogether, 
by the way.

So anyway, cygwin is working fine... well just like Unix and how it's 
supposed to in any case... which is fine.

Aaron Stephanic


Robert Menschel wrote:
> Hello Aaron,
> 
> Friday, September 10, 2004, 8:43:36 PM, you wrote to the Cygwin list:
> 
> AS> I'm having the same problem as in this thread:
> AS> http://www.cygwin.com/ml/cygwin/2004-07/msg00197.html
> 
> AS> "cd" in bash scripts is not working.  Is this a bug?
> 
> They're working here. I've had no problem with "cd" in my bash scripts
> under Cygwin, none at all in the four months I've been using Cygwin.
> 
> So the problem isn't with "cd", but with some specific combination of
> things. People on the list will need to know more about what you're doing
> in order to help.
> 
> Bob Menschel

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