Skip to content

Changes to allowable syntax and 'nounset' behaviour in bash-4.4 break stdlib.sh :( #5

Description

@srcshelton

In bash-4.3 and prior, it was possible to use ${!var:-} to reference the variable whose name is stored in var indirectly, whilst not returning an unbound variable error if nounset is enabled.

bash-4.4 removes this: the above syntax is no longer valid and the only way to safely reference a possibly-unset indirect variable is to either disable nounset or to eval the check/assignment.

Further, ${#array[@]:-} is no longer accepted syntax - need to check wether nounset breaks if referencing ${#array[@]} when array is unset or empty.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions