X-Spam-Check-By: sourceware.org Date: Tue, 8 May 2007 12:47:35 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Trouble with export Message-ID: <20070508164735.GA22873@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <10379395 DOT post AT talk DOT nabble DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10379395.post@talk.nabble.com> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Tue, May 08, 2007 at 09:40:32AM -0700, David Partridge wrote: >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 I'd wager that "./set1" has \r\n line endings. Running it through dos2unix should fix it. cgf -- 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/