On Sun, May 1, 2016 at 7:29 PM, Chet Ramey <chet.ra...@case.edu> wrote:

Thanks for the report.  This was discussed by the austin group back in 2014
> and resulted in Posix interpretation 888.
>
Thanks for the pointer. Looking at that interpretation (
http://austingroupbugs.net/view.php?id=888), I noticed that it includes one
case that bash is not handling correctly:

If there are no positional parameters, the expansion of @ shall generate
zero fields […] however, if the expansion is embedded within a word which
contains one or more other parts that expand to a quoted null string, these
null string(s) shall still produce an empty field […]

The provided example is:

set --printf '[%s]\n' foo ''"$@"*[foo]
[]*

(Bash just prints [foo]).

The attached exp9.sub and exp.right could be used for testing all the
examples from the interpretation if desired. I removed the test cases that
included undefined behavior.
​

Attachment: exp.right
Description: Binary data

Attachment: exp9.sub
Description: Binary data

Reply via email to