Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
srcshelton opened this issue Jan 18, 2018 · 1 comment
Assignees
Labels

Comments

@srcshelton
Copy link
Owner

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.

@srcshelton srcshelton changed the title Changes to allowable syntax and 'nounset' behaviour in bash-4.4 break sodlib.sh :( Changes to allowable syntax and 'nounset' behaviour in bash-4.4 break stdlib.sh :( Jan 18, 2018
@srcshelton
Copy link
Owner Author

... and Apple's autocorrect implementation is still horrendous .

@srcshelton srcshelton self-assigned this Jan 18, 2018
@srcshelton srcshelton added the bug label Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant