This is the mail archive of the cygwin 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: newbie question -- problem with launching shell script files


Alexey Illarionov wrote:

> I wrote a small script. Here is the content of the 'run.sh'
> 
> #!/bin/sh
> cd /cygdrive/c
> 
> Unfortunately, it does not work. The command './run.sh' does nothing.

Let's back up a moment.  What do you expect the above script to actually
do?  Nothing is the proper and expected behavior -- there is no way for
a child process to change the CWD of the parent so if you are expecting
the CWD to be different after running the script then you have a
misunderstanding of how scripting works.  If you want to affect things
like the CWD or environment of the current process, you can't do it by
invoking a child, you must source the contents of the script in the
current process.

Brian

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