Skip to content
Prev 22957 / 63424 Next

Buig in bin/R script (PR#9375)

On Tue, 21 Nov 2006, gml4410 at ggr.co.uk wrote:

            
This was not changed in 2.4.0, and indeed 2.2.0's bin/R used "${@}" in one 
place.
Surely this is an idiosyncracy (aka 'buig') of your OS rather than being 
'correct'?  The POSIX definition is

   @ Expands to the positional parameters, starting from one. When the
   expansion occurs within double-quotes, and where field splitting (see
   Field Splitting) is performed, each positional parameter shall expand as a
   separate field, with the provision that the expansion of the first
   parameter shall still be joined with the beginning part of the original
   word (assuming that the expanded parameter was embedded within a word),
   and the expansion of the last parameter shall still be joined with the
   last part of the original word. If there are no positional parameters, the
   expansion of '@' shall generate zero fields, even when '@' is
   double-quoted.

Note the declarative 'shall' there.

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

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.