Skip to content

error on close-parenthesis in positional parameter substitution: ksh -c 'echo "${1:+a)c}"' #907

@avih

Description

@avih

The following:

ksh -c 'echo "${1+)}"'
ksh -c 'echo "${1+a)c}"'
ksh -c 'echo "${1:+a)b}"'

error with

syntax error at line 1: `)' unexpected

In both default and POSIX modes (--posix).

All other shells I have access to think it's fine.

No such issue with non-positional parameter. These are OK:

ksh -c 'echo "${x+)}"'
ksh -c 'echo "${x+a)c}"'
ksh -c 'echo "${x:+a)b}"'

Tested with the latest ksh93u+m release: v1.0.10 (not master), built from source on Ubuntu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions