delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/05/08/12:41:05

X-Spam-Check-By: sourceware.org
Message-ID: <10379395.post@talk.nabble.com>
Date: Tue, 8 May 2007 09:40:32 -0700 (PDT)
From: David Partridge <david DOT partridge AT dharma DOT com>
To: cygwin AT cygwin DOT com
Subject: Trouble with export
MIME-Version: 1.0
X-Nabble-From: david DOT partridge AT dharma DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I just installed cygwin (1.5.24-2) on a Windows Vista machine.
When I execute a script file to set my environment variables,
they look okay but don't actually work correctly.  The following
example shows the difference between what happens when I execute
the export command directly from bash and from the script.
Note that the simple echo command appears to show that everything
is fine, but the cd command fails, and when leading and trailing
characters are echoed the variable defined in the script strangely
shows up after the trailing characters.  I cut and paste the
export command straight from the script file (both from the screen
print and from withing vi), but it still always works from the
command line and fails from the prompt.  This used to work just
fine on an older version of cygwin running on windows XP.  I've
recreated new test scripts from within cygwin to make sure there
weren't any extra control characters, but that doesn't help.

Any thoughts on what to try next would be greatly appreciated!

$ cat set1
export FRED=mydir

blah AT blah /cygdrive/c
$ export FRED=mydir

blah AT blah /cygdrive/c
$ cd $FRED

blah AT blah /cygdrive/c/mydir
$ echo $FRED
mydir

blah AT blah /cygdrive/c/mydir
$ echo "##"$FRED"**"
##mydir**

blah AT blah /cygdrive/c/mydir
$ cd ..

blah AT blah /cygdrive/c
$ . ./set1

blah AT blah /cygdrive/c
$ cd $FRED
: No such file or directory

blah AT blah /cygdrive/c
$ echo $FRED
mydir

blah AT blah /cygdrive/c
$ echo "##"$FRED"**"
**mydir

blah AT blah /cygdrive/c
$ exit

Thanks!
Dave

-- 
View this message in context: http://www.nabble.com/Trouble-with-export-tf3710761.html#a10379395
Sent from the Cygwin Users mailing list archive at Nabble.com.


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

- Raw text -


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