X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <4cee11bc0807171433l2e42ae87j3f2fdc9bb1ee7101@mail.gmail.com>
Date: Thu, 17 Jul 2008 14:33:11 -0700
From: "Sam Hanes" <elemecca@gmail.com>
To: cygwin@cygwin.com
Subject: Re: How to run a bash shell script from cygwin console
In-Reply-To: <18517238.post@talk.nabble.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <18515908.post@talk.nabble.com> <487F9BCB.8010806@sbcglobal.net> 	 <18516861.post@talk.nabble.com> 	 <20080717202137.GA891@ednor.casa.cgf.cx> 	 <18517222.post@talk.nabble.com> <18517238.post@talk.nabble.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

akarui wrote:
>
> Here from the output, I see that "cd", "pwd" and "ls" worked fine. But the
> console prompt is not yet changed, means, "cd" didn't permanently changed
> the directory, 'cause I get "pwd" as below:
> /****************
> $ pwd
> /cygdrive/d
> ****************/
>
> Note that, I like to have the console's prompt changed to "/soapui", where
> I'll run a program named "testrunner.bat" later.
>

BASH runs scripts in a sub-shell, and changes made to the environment
in the sub-shell do not propagate to the parent shell. To run a script
in the current shell so it can change your environment, call it as `.
yourscript` instead of just `yourscript`. AFAIK there's nothing that
you can put in the script to make it do this all the time.

-- Sam Hanes
elemecca AT gmail DOT com

Freedom is a heavy load, a great and strange burden for the spirit to
undertake. It is not easy. It is not a gift given, but a choice made,
and the choice may be a hard one. The road goes upward towards the
light; but the laden traveler may never reach the end of it.
- Ursula K. Le Guin; The Tombs of Atuan

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

