[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

''"$@" expansion

From: Grisha Levit
Subject: ''"$@" expansion
Date: Thu, 12 May 2016 19:37:45 -0400

On Sun, May 1, 2016 at 7:29 PM, Chet Ramey <address@hidden> 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 ''"$@"

(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

[Prev in Thread] Current Thread [Next in Thread]