delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/13/12:29:41

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Apparently-From: <earnie?boyd AT yahoo DOT com>
Message-ID: <3A896D20.B4C8ABF@yahoo.com>
Date: Tue, 13 Feb 2001 12:21:36 -0500
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: Earnie Boyd <cygwin AT cygwin DOT com>
X-Mailer: Mozilla 4.76 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Miguel Alves <miguel DOT alves AT optimus DOT pt>
CC: cygwin AT cygwin DOT com
Subject: Re: 1.1.7: Problem when "sourcing" shell files
References: <FBE64B9208B7D41180BF00508BDD06378FA85E AT lx1exc003 DOT optimus DOT pt>

Miguel Alves wrote:
> 
> I Have a simple problem with setting env variables in a shell and making
> them available to my shell.
> 
> I Just Have this script (xx.sh)
> 
> #!/bin/bash
> if [ "a" = "a" ]; then
>         export HELLO1=WORLD1
>         echo $HELLO1
> fi
> 
> echo "End"
> 
> #### END SCRIPT ######
> 
> If I execute it with the "." before the command to make the HELLO1 variable
> recognised in my bash session when the script finish. The execution gives
> the following error
> 
> malves> . xx.sh
> bash: /disk2/data/malves/bin/xx.sh: line 9: syntax error: unexpected end of
> file
> 
> If if execute it without the "."
> 
> malves> xx.sh
> WORLD1
> End
> 
> I don't get any problems.
> 
> I'am sure that this is a very stupid error how can I solve this.
> 

All I can say is, "It works for me" (tm).  Line 9 is the "#### END
SCRIPT ######" line so you could try deleting that line to see what
happens.  I did include it in my tests and it worked fine.  You could
also add a `set -o xtrace' to debug it.

YMMV,
Earnie.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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