Skip to content

ParameterExpansion does not allow empty substitution  #51

@ghost

Description

I seem to have found that the ParameterExpansion does not allow an empty substitution.

${parameter:-word}

If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.

Example:

# test if var is was set before or not
if [ -z "${var:-}" ]; then
    var="var was not set before"
fi

Could you have look or tell me where i can change the grammar to allow an empty word, so i can make a pull request.

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