www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/12/21/22:05:05

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
Message-Id: <5.0.2.1.0.20001221205136.028a8d10@pop.bresnanlink.net>
X-Sender: cabbey AT pop DOT bresnanlink DOT net
X-Mailer: QUALCOMM Windows Eudora Version 5.0.2
Date: Thu, 21 Dec 2000 21:01:52 -0600
To: cygwin AT cygwin DOT com
From: Chris Abbey <cabbey AT bresnanlink DOT net>
Subject: RE: bash wildcard expansion
In-Reply-To: <2CB1272B2212D211974D00805FCB57420AFAFBE6@MSEXCHANGE>
Mime-Version: 1.0

as others have noted java.exe is a dos program, not a cygwin
program (a fact I really hate). Dos programs are not used to
having a shell do globing for them, so they all do it them
selves (nothing like forcing everyone to reinvent the wheel).

as you've noted however double quoting the string prevents it
being globed. That's a dos mentality though, so what you need
the input of the dos program to be is the equivalent of this
char[]: {'"','*','"'}  (actually you'll want a '\0' on the end
too....)

when you run from cmd.exe that's trivial, but you're running
from bash, a REAL POSIX SHELL, which has globing built in.
So you've got to escape out any characters that are part of
the globing formula in cygwin in order to get just the right
stuff passed on to java... both " and * are part of that, so:

java someclass \"\*\"

ugly, ain't it? Makes you wish you had a java.exe that was a
real cygwin executable doesn't it? Do me a favor... call up
your nearest IBM representative and ask for it, or drop a note
into their emailbox over at ibm.com/java and ask for it. (that
goes for anyone who's interested in this btw, just don't tell
'em I sent you. ;)

At 21:36 12/21/00 -0500, Puttkammer, Roman wrote:

>sorry, my example could't have been worse: i just wanted to
>illustrate that the asterix was being expanded (by the shell?)
>even though it's escaped.
>
>the problem is: when invoking
>
>         java someclass \*
>
>the \* is being expanded to the list of files in the current
>directory (the class is invoked with a list of filenames rather
>than with a "*".) AFAIK that shouldn't be.
>
>roman


now the forces of openness
     have a powerful and
     unexpected new ally
    http://ibm.com/linux/


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