Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?UTF-8?B?U3ZlbiBLw7ZobGVy?= Newsgroups: comp.lang.java.programmer Subject: Re: exec problem is JDK 1.7.0_21 Date: Tue, 23 Apr 2013 23:28:35 +0300 Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de 7I/xfAPpK+WxM7yqWZV3DQHT9CmEj1GI2zrbvZ4TvZpI5PRF30Sq3Zjj/f Cancel-Lock: sha1:0LxS3jNda3x8izNf+0pBLZ1G+bA= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130408 Thunderbird/17.0.5 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:23598 Am 23.04.2013 00:07, schrieb Martin Gregorie: > My testprog works exactly the same when run from within my > TestProcessBuilder test class as it does when run stand-alone from the > command line: > > $ java TestProcessBuilder testprog "hello world" "\"hello world\"" > "\"hello\" \"world\"" "hello ""double quoted"" world" > argc=5 > argv[0]=testprog > argv[1]=hello world > argv[2]="hello world" > argv[3]="hello" "world" Please look at the results that Steven posted. If the String "hello\" \"world" is passed to the ProcessBuilder, the result was: argv[1]=[hello] argv[2]=[world] Oh, and then there was the neat case, of passing the two argument strings "c:\program files\" and "world" to the ProcessBuilder. The case is neat, because the external process started by ProcessBuilder is invoked with the argument string representing the path c:\program files\" world Regards, Sven