This is the mail archive of the cygwin@cygwin.com 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:
> > $ 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/


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