Timeline for Any command in my terminal that exits with non-zero code closes my terminal window
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 30, 2017 at 22:33 | vote | accept | Alexander Mills | ||
| Nov 28, 2017 at 16:14 | comment | added | Alexander Mills | So I guess local set -e could only be used in a bash function? | |
| Nov 28, 2017 at 15:39 | comment | added | ilkkachu | @AlexanderMills, to do that, you could check $- to check for the flag in the inner script and restore its state at the end, or just reset it at the main script if you know you have sourced scripts that would set it | |
| Nov 28, 2017 at 15:33 | comment | added | Alexander Mills | Apparently that's case...i wish there was something like global set -e so that set -e only affects the containing script | |
| Nov 28, 2017 at 10:17 | comment | added | Peter Cordes | Things that are safe to source in your shell is a much smaller set than just "random shell scripts". -e can be useful in actual scripts, for dumb error checking. (Or to make sure you didn't forget to error-check anything.) | |
| Nov 28, 2017 at 7:08 | history | edited | Alexander Mills | CC BY-SA 3.0 | deleted 3 characters in body |
| Nov 28, 2017 at 5:28 | history | answered | Alexander Mills | CC BY-SA 3.0 |