From c@c@voeten @ending from hum@leidenuniv@nl  Sun Sep 16 10:53:03 2018
From: c@c@voeten @ending from hum@leidenuniv@nl (Voeten, C.C.)
Date: Sun, 16 Sep 2018 08:53:03 +0000
Subject: [Rd] Rscript -e does not accept newlines under Linux?
Message-ID: <D14049CE02C4F54D95360EEC06CE45C50F937902@SPMXM08.VUW.leidenuniv.nl>

Hello,

I have found what I believe to be a bug in the Linux version of the Rscript binary.
Under Windows (official 64-bit 3.5.1 R distribution running on an up-to-date Win10), I can do the following (e.g. under powershell):

PS H:\Users\Cesko> Rscript -e 'ls()
>> ls()'
character(0)
character(0)

which works as I expect: I am running Rscript with two arguments, namely (1) '-e', and (2) two lines of code to be run, and it indeed executes those two lines of code.

This fails when attempted on a Linux build (amd64, compiled from the official 3.5.1 sources, but also reproducible with today's r-devel snapshot):

$ Rscript -e 'ls()
ls()'
ARGUMENT 'ls()' __ignored__

character(0)

This behavior is not what I expected. Have I found a bug, or am I simply using it wrong?

Regards,
Cesko


[Rd] Rscript -e does not accept newlines under Linux?
Voeten, C.C.