Re: [Rd] Rscript on Windows

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 29 Jan 2007 - 14:44:42 GMT

Haven't got any feedback on this one.

Will we be getting a perl/python/ruby style -x switch for Rscript for R 2.5.0?

It certainly would give more flexibility to users of Rscript on non-UNIX systems where #! notation is not available.

On 1/26/07, Gabor Grothendieck <ggrothendieck@gmail.com> wrote:
> Good idea. ruby seems to work the same way. python does too but with
> a slightly different definition:
>
> C:\> ruby -h | findstr strip
> -x[directory] strip off text before #!ruby line and perhaps cd to directory
>
> C:\> perl -h | findstr strip
> -x[directory] strip off text before #!perl line and perhaps cd to directory
>
> C:\> python -h | findstr skip
> -x : skip first line of source, allowing use of non-Unix forms of #!cmd
>
>
> On 1/26/07, Vladimir Eremeev <wl2776@gmail.com> wrote:
> >
> > ActivePerl has '-x' switch which tells it to skip all lines in the file till
> > "#!".
> > This allows writing perl scripts in ordinary .bat files.
> >
> > ?shQuote contains a link with the following perl script example:
> > ===8<===
> > @echo off
> > :: hello.bat
> > :: Windows executable Perl script
> > :: Note:
> > :: assumes perl.exe is in path
> > :: otherwise, use absolute path
> > perl -x -S "%0" %*
> > goto end
> > #!perl
> >
> > print "Hello, World!\n";
> > __END__
> > :end
> > :: ------ end of hello.bat ------
> >
> > Windows Notes:
> > " -x " (lower case x): Skip all text until shebang line.
> > " -S " (upper case S): Look for script using PATH variable. Special meaning
> > in Windows: appends .bat or .cmd if lookup for name fails and name does not
> > have either suffix.
> > " %* " only on WinNT/2K/XP; use %1 %2 . . . %9 on Win9x/DOS
> > ===8<===
> >
> > I think the simplest way to implement shebang on windows would be embedding
> > one more command line switch with similar functionality to perl's '-x'.
> >
> > --
> > View this message in context: http://www.nabble.com/Rscript-on-Windows-tf3120774.html#a8651815
> > Sent from the R devel mailing list archive at Nabble.com.
> >



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Jan 30 01:49:07 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 16 Feb 2007 - 15:31:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.