From c@@rd|@g@bor @end|ng |rom gm@||@com  Tue Mar 19 11:09:50 2019
From: c@@rd|@g@bor @end|ng |rom gm@||@com (=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=)
Date: Tue, 19 Mar 2019 10:09:50 +0000
Subject: [Rd] Possibly broken system2 env-option
In-Reply-To: <3244E2B3-3E44-4469-919B-4E5768F06F23@gmail.com>
References: <f38d1b55-c8f8-dbe4-94c4-bf15bb32c052@gmx.de>
 <3244E2B3-3E44-4469-919B-4E5768F06F23@gmail.com>
Message-ID: <CABtg=K=RUYOXkgUgMmMKxYcmDTm9ZUNt2bErKLrs9wiMx1B50w@mail.gmail.com>

On Tue, Mar 19, 2019 at 9:59 AM peter dalgaard <pdalgd at gmail.com> wrote:
[...]
> What you need is something like (NB: single quotes!)
> > system2("sh", env = c("VAR='Hello World'"), args = c("-c 'echo $VAR'"))
> Hello World

Just out of curiosity, do you think it is possible to make this
portable, assuming sh is available? On Windows it gives

> system2("sh", env = c("VAR='Hello World'"), args = c("-c 'echo $VAR'"))
/rtools34/bin/sh: VAR=Hello World: No such file or directory
Warning message:
running command '"sh" VAR='Hello World' -c 'echo $VAR'' had status 127

G.



[Rd] Possibly broken system2 env-option
=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=