Having a quick look at CommandLineArgs.c (yuck! :-P) and some 
experimentation shows that a workaround could be

Rscript ./size.R


or the equivalent

R --file=./size.R


Hope this helps a little.

Allan

For developers: I'm /guessing/ the problem is in CommandLineArgs.c 
around the line

            else if(strncmp(*av+7, "size", 4) == 0) {


which looks like a nasty hack that just happens to match --file=size.R 
as well as --min-vsize=N et al that it tries to detect.  But seriously: 
there are libraries for options parsing!



On 08/07/10 07:49, Allan Engelhardt wrote:
> It looks like a bug in R, not Rscript: what Rscript does is effectively
>
> R --file=size.R
>
>
> and you can easily test that
>
> echo 'print("Hello world")'>  size.R
> R --file=size.R
>
>
> give you the error while
>
> cp size.R asize.R
> R --file=asize.R
>
>
> works as expected.
>
> None of which helps you directly, but perhaps one of the developeRs 
> can help fix what seems to be broken options parsing in the R code.
>
> Allan
>
> On 08/07/10 04:43, thmsfuller...@gmail.com wrote:
>> Hello All,
>>
>> It seems weird to me that Rscript does the following thing and enters
>> the R prompt mode. If I change the file name to something that doesn't
>> start with 'size', then Rscript runs normally. Does anybody know what
>> is going on?
>>
>> $ Rscript size.R
>> WARNING: '--file=size.R' value is invalid: ignored
>>
>>
>> $ Rscript --version
>> R scripting front-end version 51072
>>
>>
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to