[R-SIG-Mac] system command in OS X failed when ampersand was added to command

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Mar 6 18:49:38 CET 2011


On Sun, 6 Mar 2011, Noah Lorang wrote:

> I'm not able to replicate using the same setup on several computers, either with R.app or R running in the terminal, so it's likely something highly specific to your setup. I'd suggest reinstalling or upgrading R and see if the problem goes away.
>
> The clearer way to do this in R, in my opinion, is to use the 
> wait=FALSE flag in system(), which has the same effect as & directly 
> in the shell.

Hmm, as documented, it actually appends & to the shell command for 
you.  Whether that is clearer depends on the reader, but wait=FALSE is 
cross-platform.

>
> Noah
>
> On Mar 6, 2011, at Mar 6 10:29 AM , Dennis Fisher wrote:
>
>> Colleagues
>>
>> I just encountered an odd problem with the system command; perhaps someone can provide some insight.
>> At some point in the past (~ 6 months ago; I was using the latest version of R and Snow Leopard available at the time), the command:
>> 	system("open -a /complete/path/to/app /complete/path/to/file &")
>> ran successfully.
>>
>> I am using R 2.12.0 and OS X.6.6 and the command failed.  To my surprise, removed the ampersand fixed the problem.  I don't know if the problem lies with OS X or R's interaction with OS X.  Does anyone have any insights into this?
>>
>> Dennis
>>
>>
>> Dennis Fisher MD
>> P < (The "P Less Than" Company)
>> Phone: 1-866-PLessThan (1-866-753-7784)
>> Fax: 1-866-PLessThan (1-866-753-7784)
>> www.PLessThan.com
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-SIG-Mac mailing list