You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tested in bash 4.3+
when setting 'set -u' in example/array.sh, I receive:
bash-oo-framework/lib/util/command.sh: line 34: $3: unbound variable
there are more errors elsewhere, after performing "${unboundvar:-}"
Is this conscious design decision related to bash version?
Sometimes I want my script to fail, not to cause more mayhem in unpredictable way. How to overcome this?
The text was updated successfully, but these errors were encountered:
Hi @adudek! The framework was not tested with set -u - we'd like to fix it, and unbound vars are a known issue, if I'm not mistaken @tterranigma was trying to track them down and fix them. we're brainstorming a simplification of the framework in #45.
niieani
changed the title
set -u causes examples to fail
Unbound variables cause a crash when running examples with 'set -u'
Oct 5, 2018
Note for future: "most sane" bash settings that I recommend should include at least:
set +H -euo pipefail (-e should be suppressed only in try block)
it is a pain to handle all potentially unassigned values, but less than potentially destroying data :)
tested in bash 4.3+
when setting 'set -u' in example/array.sh, I receive:
bash-oo-framework/lib/util/command.sh: line 34: $3: unbound variable
there are more errors elsewhere, after performing "${unboundvar:-}"
Is this conscious design decision related to bash version?
Sometimes I want my script to fail, not to cause more mayhem in unpredictable way. How to overcome this?
The text was updated successfully, but these errors were encountered: