[R] PHP escapeshellcmd() equivalent

Roebuck,Paul L proebuck at mdanderson.org
Fri Aug 24 22:17:34 CEST 2012


On 8/24/12 2:59 PM, "R. Michael Weylandt" <michael.weylandt at gmail.com>
wrote:

> On Fri, Aug 24, 2012 at 2:48 PM, Roebuck,Paul <proebuck at mdanderson.org>
> wrote:
>> [Redirected from R-Devel...]
>> 
>> Not that I recall running across such, but does R (or CRAN package)
>> provide something equivalent to PHP's escapeshellcmd() function
>> to escape shell job control, wildcards, etc?
>
> I don't know PHP, but what does escapeshellcmd() provide over and
> above what system() / system2() do?
> 

As before, it escapes job control, etc from the command string.
Assuming such existed in R, it would be used something like this:

R> system(escapeshellcmd(sprintf("somecmd %s", untrustedInput1)))




More information about the R-help mailing list