Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #11596
| From | Christoph Gysin <christoph.gysin@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: command substitution is stripping set -e from options |
| Date | 2015-10-08 23:28 +0300 |
| Message-ID | <mailman.59.1444336333.4386.bug-bash@gnu.org> (permalink) |
| References | (6 earlier) <56103208.30406@case.edu> <CADex794ttQa_b9NBGKJMsXj36yoRL3JQ16aja=S8=hAxGgzCQA@mail.gmail.com> <56168B10.1000905@case.edu> <CADex796=T3x11Y5Tz7udh7UzpYDaOY+0-EatZrAu2hGNRZ=gqg@mail.gmail.com> <20151008184939.GW25574@eeg.ccf.org> |
> I know you don't want to hear this, but you really need to stop thinking > of set -e as "error checking". It is an obsolescent historical anomaly > that bash is required to support because POSIX specifies it. It isn't > useful for any purpose, and people who insist on using it are simply > causing extra pain for themselves. This is simply not true. It provides the automatic "|| exit 1" if you know what special cases you need to avoid. I believe I am aware of all those special cases. I'm willing to take that pain for the advantage of having the script fail when any command called unexpectedly fails. It saves me from the even greater pain of debugging the root cause without any hint where it started going wrong. > If you dislike this, then switch your project to a programming language > that *has* automatic error checking. Bash is just a shell, and there > are many other languages that may better suit your project. Unfortunately bash is the default system shell on a gazillion of devices out there, so switching "my project" is not as trivial as it might sound. Chris -- echo mailto: NOSPAM !#$.'<*>'|sed 's. ..'|tr "<*> !#:2" org@fr33z3
Back to gnu.bash.bug | Previous | Next | Find similar
Re: command substitution is stripping set -e from options Christoph Gysin <christoph.gysin@gmail.com> - 2015-10-08 23:28 +0300
csiph-web