Subject: Re: bin/33956: -current /bin/sh possible regression
To: David Holland <dholland+netbsd@eecs.harvard.edu>
From: Rhialto <rhialto@falu.nl>
List: current-users
Date: 07/12/2006 02:09:39
On Mon 10 Jul 2006 at 18:05:32 -0400, David Holland wrote:
>    sh -c 'foo() { printargv "Testing ${@} fnord"; }; foo a b'

In my view, the *real* problem is that the above case simply is
undefined, hence any particular output is never a bug.

Look at the manpage (from 3.0):

     @            Expands to the positional parameters, starting from one.
                  When the expansion occurs within double-quotes, each posi-
                  tional parameter expands as a separate argument.  If there
                  are no positional parameters, the expansion of @ generates
                  zero arguments, even when @ is double-quoted.  What this
                  basically means, for example, is if $1 is ``abc'' and $2 is
                  ``def ghi'', then "$@" expands to the two arguments:

                        "abc" "def ghi"

This arguably only defines "$@", not if anything else is between the quotes.
The author of that definition simply never contemplated that case.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl        -- Cetero censeo "authored" delendum esse.