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

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
Date: Thu, 21 Dec 2000 22:06:45 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Cc: roman DOT puttkammer AT multex DOT com
Subject: Re: bash wildcard expansion
Message-ID: <20001221220645.A7187@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>,
roman DOT puttkammer AT multex DOT com
References: <2CB1272B2212D211974D00805FCB57420AFAFBE7 AT MSEXCHANGE>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <2CB1272B2212D211974D00805FCB57420AFAFBE7@MSEXCHANGE>; from roman.puttkammer@multex.com on Thu, Dec 21, 2000 at 09:53:49PM -0500

On Thu, Dec 21, 2000 at 09:53:49PM -0500, Puttkammer, Roman wrote:
>> -----Original Message-----
>> From: Christopher Faylor [mailto:cgf AT redhat DOT com]
>> Sent: Thursday, December 21, 2000 9:31 PM
>> To: 'cygwin AT cygwin DOT com'
>> Cc: roman DOT puttkammer AT multex DOT com
>> Subject: Re: bash wildcard expansion
>> 
>> 
>> On Thu, Dec 21, 2000 at 08:40:02PM -0500, Puttkammer, Roman wrote:
>> >
>> >I hope i'm not getting flamed for this one, but what am I missing? A 
>> >command line argument is being expanded by bash even though 
>> it's escaped.
>> >
>> >  /tibrv/src/examples/java# D:/jdk1.3/bin/java.exe \*
>> >  Exception in thread "main" java.lang.NoClassDefFoundError:
>> >cmlistener/class
>> >
>> > ...
>> The fact that you notice that ls works as expected should be a pretty
>> large clue.
>> 
>> ls.exe is a cygwin program.  java.exe is not a cygwin program.  You
>> can't expect jave.exe to work well with a cygwin application 
>> like bash.
>> In this case, java.exe is expanding the command line '*' itself, just
>> like any non-cygwin MS-DOS application does.
>
>
>I see. Is there any way of achieving the same under cygwin as the
>following command does under dos?
>
>	java myclass "*"
>
>This results a litteral asterix being passed to the class. I figgured
>that in this case, under cygwin one of following commands
>
>	java myclass '"*"'
>	cmd /c java test '"*"'
>	cmd /c 'java test "*"'
>
>should have the same effect. But they don't - the double quotes are
>not stripped from the argument (which java.exe seems to be doing when
>invoked from DOS.)
>
>Is there any way to get the same behaviour under cygwin?

Using '"*"' in bash causes a "*" (i.e., double-quote, asterisk,
double-quote) to be passed to a program.  I just verified this with an
"echoargs" program compiled with both mingw and MSVC.  When I use a
'"*"' on the command line the mingw or msvc application sees a "*" as
its argv[0].

Or, more specifically, what the programs sees is:

c:\tmp\echoargs.exe "\"*\""

It looks like java is somehow confused by this.  I really don't
understand why it should but it still looks like a problem with the java
program to me.

cgf

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