delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/12/04/19:55:13

From: jeffdbREMOVETHIS AT netzone DOT com (Mikey)
Subject: Re: bash problem. (Am I missing something?)
4 Dec 1997 19:55:13 -0800 :
Message-ID: <34870cc6.70818231.cygnus.gnu-win32@smtp.netzone.com>
References: <19971203125444 DOT 14018 DOT qmail AT hotmail DOT com>
Reply-To: jeffdbREMOVETHIS AT netzone DOT com
Mime-Version: 1.0
To: gnu-win32 AT cygnus 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 AT hotmail DOT 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 AT cygnus DOT com" with one line of text: "help".
>

(jeffdbREMOVETHIS AT netzone DOT 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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019