From ant-user-return-18222-qmlist-jakarta-archive-ant-user=jakarta.apache.org@jakarta.apache.org Thu Mar 07 01:08:30 2002 Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 27538 invoked from network); 7 Mar 2002 01:08:30 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Mar 2002 01:08:30 -0000 Received: (qmail 28489 invoked by uid 97); 7 Mar 2002 01:08:27 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 28465 invoked by uid 97); 7 Mar 2002 01:08:26 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 28454 invoked from network); 7 Mar 2002 01:08:26 -0000 From: "Adam Murdoch" To: "Ant Users List" Subject: RE: Own task. Commandline Date: Thu, 7 Mar 2002 11:05:42 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <5802F7678945D51184440002557C81E20256DDCB@Server1b.office.isaserver.be> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, The Sun JVM does a really poor job of dealing with quotes in arguments. One way you can get around this is to wrap your double-quoted arg in single-quotes. For example, in the following: > Commandline commandLine = new Commandline(); > commandLine.setExecutable("cmdclient"); > commandLine.createArgument().setValue("-user"); > commandLine.createArgument().setValue("\"integrator\""); replace the last line with commandLine.createArgument().setValue("\'\"integrator\"\'"); This works for Sun JVMs on Windows. Don't know about other platforms or JVMs. Perhaps a better option is to fix the executable to behave a little better as a command-line tool. Or write a wrapper script. Adam > -----Original Message----- > From: Natalia Bello [mailto:NBELLO@isabel.be] > Sent: Wednesday, 6 March 2002 12:56 AM > To: 'Ant Users List' > Subject: Own task. Commandline > > > Hello! > I am trying to develop my own task; in this task I need to > execute a command > line like this: > cmdclient -user "integrator" -pass "password" .. > that is, i need to set the arguments between double quotes!! > I have tried some posibilites, but i havent success! > If i try for example > Commandline commandLine = new Commandline(); > commandLine.setExecutable("cmdclient"); > commandLine.createArgument().setValue("-user \"integrator\""); > log("Executing " + commandLine.toString()); > > I get: > [CBL] Executing cmdclient '-user "integrator"' > > or this other > Commandline commandLine = new Commandline(); > commandLine.setExecutable("cmdclient"); > commandLine.createArgument().setLine("-user > \"integrator\""); > log("Executing " + commandLine.toString()); > I get: > [CBL] Executing cmdclient -user integrator > > or: > Commandline commandLine = new Commandline(); > commandLine.setExecutable("cmdclient"); > commandLine.createArgument().setValue("-user"); > commandLine.createArgument().setValue("\"integrator\""); > log("Executing " + commandLine.toString()); > > I get again: > [CBL] Executing cmdclient -user integrator > > Does anyone now how i can do this? > Thanks in advanced, > Natalia > -- To unsubscribe, e-mail: For additional commands, e-mail: