This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: bash wildcard expansion


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]