Re: [Rd] Buig in bin/R script (PR#9375)

From: <gml4410_at_ggr.co.uk>
Date: Tue 21 Nov 2006 - 15:22:05 GMT


Prof Brian Ripley wrote:

>>
>> Changes to the bin/R front-end interlude script at 2.4.0 (cf: 2.2.0) 
>> have broken R on (Dec/Compaq/HP) OSF1.

>
> This was not changed in 2.4.0, and indeed 2.2.0's bin/R used "${@}" in
> one place.

    The 2.2.0 usage only came into play if CMD was on the command line, and there would then be a following parameter, so "${@}" contained something.

    At 2.4.0 this has been appended to 2 further lines in circumstances where it can easily be empty.

>> The fix is to edit src/scripts//R.sh.in to use the correct, original 
>> Bourne shell syntax:

>
> Surely this is an idiosyncracy (aka 'buig') of your OS rather than being
> 'correct'? The POSIX definition is
>
> [http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_05_02]
>
> Note the declarative 'shall' there.

    Agreed, but that definition was post-dated. Many systems behaved differently before that was written.

> Further, Solaris has a genuine Bourne shell from the AT&T source code
> base, and it is both documented and behaves as this quotation.

    I'll agree it works (Sol8, Sol9 and Sol10), but it isn't documented in the sh man page.

> Perhaps we need a workaround conditional on 'HAVE_OSF_BROKEN_SH', but I
> am not at all keen to complicate simple POSIX-compliant code
> unconditionally.

    Using ${1+"$@"} is POSIX compliant also, and has the advantage of working everywhere. See:

http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Nov 22 06:59:23 2006

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 Tue 21 Nov 2006 - 23:30:50 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.