Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.cloud9consultinginc!news.posted.cloud9consultinginc.POSTED!not-for-mail NNTP-Posting-Date: Fri, 11 Jan 2013 15:27:59 -0600 Newsgroups: comp.lang.java.programmer From: "A. Bolmarcich" Subject: Re: problem with multiword args and Runtime.exec() References: <05a24a02-1ac3-4866-ba2b-20c488793b96@googlegroups.com> Message-ID: User-Agent: slrn/0.9.8.0 (FreeBSD) Date: Fri, 11 Jan 2013 15:27:59 -0600 Lines: 14 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 168.100.1.1 X-Trace: sv3-I9WgC1fKyad09Ty6M3d3QRVUpBFvCEhp2IbxpYq9p1/4yuZeFnXi22aEa7p16s2Riqy776s4CmikNt1!BJkPKNh/ipGAi/PFeAOwzJfD+Ru8naswq3XtpZOcqx9Xg1lb7YTHohvUyu9Gb1m9m21j0XQwEa4y!n0ZCdW3NAMomN7xEinQ= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1874 Xref: csiph.com comp.lang.java.programmer:21336 On 2013-01-11, Aryeh M. Friedman wrote: > No matter what version of Runtime.exec I call I can not make a arg that has multiple words in it (*NOT* multiple args but a single one) for example if I need to issue the following command in unix I can not find a way to do the stuff in "'s as a single arg [the called program requires this... i.e. it *MUST NOT* be treated as different elements of String[] args if it was a java program]): > > rdiff-backup --remote-schema "ssh -C -p9222 %s rdiff-backup --server" username@remoteserver::/path_to/filestobackup /path_to/backedupfiles Did you try Runtime.exec(String[]), as in the following? exec(new String[] { "rdiff-backup", "--remote-schema", "ssh -C -p9222 %s rdiff-backup --server", "username@remoteserver::/path_to/filestobackup", "/path_to/backedupfiles" })