Displaying 2 results from an estimated 2 matches for "bredel".
Did you mean:
brendel
2019 Mar 18
4
Possibly broken system2 env-option
Hey all,
what is wrong with this command:
system2("echo", env = c(VAR = "Hello World"), args = c("$VAR"))
I am a bit confused, as help("system2") writes about the env option:
> character vector of name=value strings to set environment variables.
Is this option buggy, or am I using it just wrong?
Thanks for your help
Henning
2019 Mar 19
0
Possibly broken system2 env-option
...bar
What you need is something like (NB: single quotes!)
pd$ VAR="foo" sh -c 'echo $VAR'
foo
So:
> system2("sh", env = c("VAR='Hello World'"), args = c("-c 'echo $VAR'"))
Hello World
-pd
> On 18 Mar 2019, at 17:28 , Henning Bredel <h.bredel at gmx.de> wrote:
>
> Hey all,
>
> what is wrong with this command:
>
> system2("echo", env = c(VAR = "Hello World"), args = c("$VAR"))
>
> I am a bit confused, as help("system2") writes about the env option:
>...