This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: bash problem. (Am I missing something?)
- To: gnu-win32 at cygnus dot com
- Subject: Re: bash problem. (Am I missing something?)
- From: jeffdbREMOVETHIS at netzone dot com (Mikey)
- Date: Thu, 04 Dec 1997 20:34:11 GMT
- Organization: Never
- References: <19971203125444.14018.qmail@hotmail.com>
- Reply-To: jeffdbREMOVETHIS at netzone dot com
Thank you for the information ;^)
However executing the script via
source ./test.sh or
source test.sh or
. test.sh
(^ note space)
has the intended result, the var gets set in the current shell
the reason I said to use source instead of . is that . is
ambiguous in a mail message. see. .-)
executing via a $PATH search like this
test.sh
or by
./test.sh
like he did the variable remains unset. which would
indicate to me that the script is executed in a subshell, as I stated.
On Wed, 03 Dec 1997 04:54:44 PST, you wrote:
>
>
>>
>>try
>>
>>source ./test.sh
>>
>>#!/bin/sh causes the script to run in a subshell, so any exports
>>are lost when the toplevel shell resumes. at least I think that's
>right;^)
>
>wrong. source is equates to Bourne's . command which will read the
>given FILENAME and execute the commands in the current shell context.
>This means that any environment variable set will remain at the end of
>the script. Any cd performed will remain in effect as well.
>
>>no idea where the error comes from unless #! aren't the very first 2
>chars in the file.
>>
>
>I believe the problem to be \r in the script file. And possibly
>text!=binary.
>
>[snip]
>
>- \\||//
>---o0O0--Earnie--0O0o----
>-earnie_boyd@hotmail.com-
>------ooo0O--O0ooo-------
>
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>-
>For help on using this list (especially unsubscribing), send a message to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>
(jeffdbREMOVETHIS@netzone.com)
delete REMOVETHIS from the above to reply
Mikey
Windows vs Linux is a no-win situation.
Windows 95: -- 32-bit extensions and a GUI
shell for a 16-bit patch to an 8-bit OS
originally coded for a 4-bit processor
written by a 2-bit company that
can't produce 1 bit of quality.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".