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

Bug#1063518: console-setup: setupcon: 1386: Syntax error: Missing '))'



Thorsten Bonow <toto@not-in-kansas-anymore.org> writes:

[...]

But what's POSIX take on this?  I couldn't find anything.  Is this a
bug in dash or in setupcon?

I'm stupid[1].  It's a bug in setupcon, POSIX requires the space:

"The syntax of the shell command language has an ambiguity for
expansions beginning with "$((", which can introduce an arithmetic
expansion or a command substitution that starts with a subshell.
Arithmetic expansion has precedence; that is, the shell shall first
determine whether it can parse the expansion as an arithmetic
expansion and shall only parse the expansion as a command substitution
if it determines that it cannot parse the expansion as an arithmetic
expansion.  The shell need not evaluate nested expansions when
performing this determination.  If it encounters the end of input
without already having determined that it cannot parse the expansion
as an arithmetic expansion, the shell shall treat the expansion as an
incomplete arithmetic expansion and report a syntax error.  A
conforming application shall ensure that it separates the "$(" and '('
into two tokens (that is, separate them with white space) in a command
substitution that starts with a subshell.  For example, a command
substitution containing a single subshell could be written as:

$( (command) )"


Footnotes:
[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_03


Reply to: