delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/24/11:21:16

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Thu, 24 Apr 2003 11:20:28 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Steve <beforewisdom AT yahoo DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Cygwin Bash Script Syntax Question
In-Reply-To: <b88uhj$2o1$1@main.gmane.org>
Message-ID: <Pine.GSO.4.44.0304241115290.10996-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Thu, 24 Apr 2003, Steve wrote:

> Hi;
>
> I am using cygwin on win2k.
> I have a __native__  JDK 1.3 installed.
>
> I am trying to write myself a bash script to do some compiling jobs.
> I am having trouble getting some path syntax issues ironed out.
>
> The native java will accept either  C:\FOO\FOO  or C:/FOO/FOO
> The native java will not accept /cygdrive/c/FOO/FOO
>
> After some experimentation it seems that bash is getting confused about
> the ':' symbol.  It seems to be interpreting the ':' in C:/foo as a path
> seperator so
>
> PATH=C:/foo:C:/foa
>
> is getting interpreted as specifiying these dirs:
> C:/foo
> C
> foo
>
> Anyway I would like to write a script that would look like this
> in a .sh file:
>
> ----------------------------------------
> export SOURCEDIR=C:/foo
> export OUTDIR=C:/foa
> export CLASSPATH=C:/abc:C:/def:C:/ghi
>
> javac -sourcepath $SOURCEDIR -d $OUTDIR -classpath $CLASSPATH $1
> ------------------------------------------
>
> So.....what would the path syntax be like?
> Do I use ':' or ';' as directory seperators?
> Do I use '/' or '\' ?
>
> I'm sorry if this seems lame but I am getting dizzy from tyring to make
> a native windows installation of java work with a cygwin .sh file
>
> Any help will be appreciated
>
> STeve

Steve,

Bash doesn't do any special variable translation when calling Windows
apps, so JDK gets the CLASSPATH exactly how you define it.  Since the JDK
expects a CLASSPATH in Win32 format with ";" as a separator, that's the
format you have to set CLASSPATH in.  Don't forget to escape the ";" with
"\" in bash, so it doesn't interpret ";" as the command separator.  Since
the JDK accepts both "/" and "\" as directory separators, it doesn't
matter which one you use (but you'll have to escape the "\"s in bash).

You could also define CLASSPATH in POSIX format and use `cygpath -mp` or
`cygpath -wp` to translate it to Windows format.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II


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