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 From: "Hannu E K Nevalainen" To: Subject: RE: bash script does't work. Date: Mon, 3 Nov 2003 13:15:15 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <3FA54090.8000801@easyconnect.fr> Importance: Normal > From: Pierre-Philippe Coupard > Sent: Sunday, November 02, 2003 6:36 PM > 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). "." is shortcut for "source" Typing this, and reading the text that appears, should help explain things: $ man bash /ENVIRONMENT $ help source $ man bash /BUILTIN COMMANDS$ IMO there is one big shortcoming with "source" - it can't be piped into. /Hannu E K Nevalainen, B.Sc. EE - 59?16.37'N, 17?12.60'E -- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); -- --END OF MESSAGE-- -- 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/