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

gml4410 at ggr.co.uk gml4410 at ggr.co.uk
Tue Nov 21 16:22:05 CET 2006


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



More information about the R-devel mailing list