[R] "#!/usr/bin/R"

wwsprague@ucdavis.edu wwsprague at ucdavis.edu
Mon May 10 23:15:07 CEST 2004


Hi

> Associated with that attempt was a modification of the sources that I 
> made, commenting out two lines in system.c, specifically:
> 
> See file ./source/src/unix/system.c
> line 239 in R-1.8.1 patched as of 12/3/03
>             snprintf(msg, 1024, "ARGUMENT '%s' __ignored__\n", *av);
>             R_ShowMessage(msg);

I would argue that this code should be removed or made optional, because 
it gets in the way of using R or R.bin in pipelines, cgi scripts, or 
whatever (and thus violates Unix design principles).  Is there some 
other reason for its inclusion?  (I haven't looked at the source, so 
take my comments with the appropriate grains of salt.)

> 
> This was because I wanted to use R for cgi scripts, and that warning 
> message preceded the html headers that, according to html 
> specifications, *must* come first. Otherwise the broswer chokes.
> 
> If I recall correctly, that modification is not necessary simply to 
> create and run such scripts. Only in the context of using R as a cgi 
> engine did I find it necessary.

That is my reason for wanting to use a #! thing too.

> Of course, there may have been a better way, or there may be a better 
> way now, but that is what I found at the time.

I think that a goal should be that R is as easy to incorporate into 
scripts as Perl or sh are.  Thoughts?  Have I bit myself off a project?

Webb




More information about the R-help mailing list