This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: bash script does't work.

> From: Pierre-Philippe Coupard
> Sent: Sunday, November 02, 2003 6:36 PM

> Seiji Yoneda wrote:
> > $        <---------------- 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 "." 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

$ help source

$ man bash

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

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]