Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <3FA54090.8000801@easyconnect.fr>
Date: Sun, 02 Nov 2003 18:36:16 +0100
From: Pierre-Philippe Coupard <pcoupard@easyconnect.fr>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030930 Debian/1.4-5
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: bash script does't work.
References: <20031103014206.4964.S-YONEDA@spn1.speednet.ne.jp>
In-Reply-To: <20031103014206.4964.S-YONEDA@spn1.speednet.ne.jp>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Seiji Yoneda wrote:
> $ ora8i.sh        <---------------- Execute this script

--8<--8<--

> $ printenv ORA_HOME   <---------------- After execution of script
>     <----------- After execution, ORA_HOME has nothing !!
> $ printenv PATH   <---------------- After execution, PATH does't change!!

This isn't a cygwin issue.

Because the PATH you change in your script is a variable that's local to 
the shell running it. Because you call your script as a binary, another 
shell is spawned (the #!/bin/sh basically tells the kernel to use 
/bin/sh as the interpreter).

Try running you script as ". ora8i.sh" and it'll work : the "." is a 
shell command that means "execute this shell script" (in the current shell).

-- 
Pierre-Philippe Coupard <pcoupard@easyconnect.fr>
Software Engineer
--
Does the name Pavlov ring a bell?


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

