4 ms·
Bourne shell, bash, etc. are all “on error resume next” by default. You have to `set -euo pipefail` explicitly.
by bargle0 5y ago
Bourne shell, bash, etc. are all “on error resume next” by default. You have to `set -euo pipefail` explicitly.
- xiaq 5y agoIf you're interested in a shell that doesn't do "on error resume next", take a look at Elvish :) https://elv.sh/learn/tour.html#exceptions https://elv.sh/learn/tour.html#exceptions
- eikenberry 5y agoA bit pedantic, but to be clear `set -e` is the call to change the behavior from "on error resume next" to "on error exit". The `-u -o pipefail` are both other common error settings, but unrelated to that behavior.
- jeeyoungk 5y agoPipefail is actually relevant here; because the difference between `-e` and `-o pipefail` is whether “on error resume next” is supported for `cmd;cmd` versus `cmd|cmd`.
- jolmg 5y agoAlso languages without exceptions, like C.
- tompazourek 5y agoPowerShell also does this and is often used by the .NET folk that just expect the exceptions to work as usual. This causes so many issues...
- majkinetor 5y ago$ErrorAction = 'STOP' and you are done with it.