delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/12/03/01:58:35

From: jeffdbREMOVETHIS AT netzone DOT com (Mikey)
Subject: Re: bash problem. (Am I missing something?)
3 Dec 1997 01:58:35 -0800 :
Message-ID: <34879d39.87374718.cygnus.gnu-win32@smtp.netzone.com>
References: <c=US%a=INFONET%p=NESTLE%l=NESTLE-US01-0037D28F AT phx1nm02 DOT nesusa DOT com>
Reply-To: jeffdbREMOVETHIS AT netzone DOT com
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

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;^)
no idea where the error comes from unless #! aren't the very first 2 chars in the file.

to test shell scripts do

set -xv

either as the first command in the script, or at the command line,
and this will echo all commands.

set -axv

will export the -xv setting to subshells

On Tue, 2 Dec 1997 05:35:57 -0800, you wrote:

>I downloaded the coolview patch, and have run into a strange problem 
>with bash:
>
>let's say I have a file called test.sh:
>------------------------------
>#!/bin/sh
>
>export TESTVAR=1
>------------------------------
>
>If I try to run it, (after chmod-ing and all that...)
>
>like this:
>
>sh-2.01$ . ./test.sh
>
>I get this error:
>
>sh: ./test.sh: error 0
>
>And the TESTVAR variable isn't defined.  Can anyone tell me what I'm 
>doing wrong?
>
>Thanks.
>
>
>

(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