delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/03/08/16:08:30

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Jerome Fong <jfong AT successmetricsinc DOT com>
Subject: how do you create an usable path variable with a space in it?
Date: Thu, 08 Mar 2007 12:16:52 -0800
Lines: 30
Message-ID: <espqv3$i5t$1@sea.gmane.org>
Mime-Version: 1.0
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
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've been trying to create a variable for my Java home 
(/cygdrive/c/Program\ Files/Java/jdk1.5.0_10).  However, no matter how I 
seem to create it, I am not able to use it.  I read some threads that 
suggest creating a symlink without the space in the path name, but is 
that my only option?

What is weird is, I have set "echo on", the path it uses to find 
java.exe is correct and if I cut and paste it to the command line, it 
works.   Here is what I did:

# create variable

export JAVA_HOME='/cygdrive/c/Program\ Files/Java/jdk1.5.0_10'

echo $JAVA_HOME
/cygdrive/c/Program\ Files/Java/jdk1.5.0_10

"$JAVA_HOME"/bin/java.exe -cp "$CLASSPATH" ....
./test.sh: line 32: /cygdrive/c/Program\ 
Files/Java/jdk1.5.0_10/bin/java.exe: No such file or directory


However, when I copy the command and run it interactive, the command 
works.  I seem to be getting the backslash in the right spot, and it 
does work interactively.  What else should I do?  Should I be adding 
more quotes or something?  Any idea what I am doing wrong?

thanks,

Jerome


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