Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!not-for-mail From: Christoph Gysin Newsgroups: gnu.bash.bug Subject: Re: command substitution is stripping set -e from options Date: Thu, 8 Oct 2015 23:28:17 +0300 Lines: 25 Approved: bug-bash@gnu.org Message-ID: References: <560D83DA.9020405@redhat.com> <20151002122925.GK25574@eeg.ccf.org> <20151002132221.GL25574@eeg.ccf.org> <56103208.30406@case.edu> <56168B10.1000905@case.edu> <20151008184939.GW25574@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: usenet.stanford.edu 1444336334 28885 208.118.235.17 (8 Oct 2015 20:32:14 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: Greg Wooledge Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=+Xr9RXg7/kV7guQcgGMbyT7v0csabrpiWhFM0ce//JE=; b=d90UNrtGne2zqidwCOzl5Lr6xTKAnIT19jXnWh0aX2n0lUGCs1sXr8oOlel85WLnyr rzP/AnAgE5IjnrAwoQ6kKXlL1LOVNTELfBWzUA9ktUNEta5jRGoJRGG4pmollN7L7Hqh scpEGOGWrndRaJt6+NhIUjyFYUIolp4oS4pCD4DwZfnrGD1RirkMpei4aRbBbyAUvWtK mmRCSC0QHmKdR237oenoqz6Qhji/bcbyYnijrQ6SR1jzX9y2Pj2P+P2iSPWd7VhP/6Ew 4E3Xfz1q3RZLZ5jRe9URspYC5A/RreXLrIoi+MNEeAvFFWTFLvZIjpkgrP4K7Vx65Kpy wjgg== X-Received: by 10.112.202.35 with SMTP id kf3mr4667542lbc.19.1444336136632; Thu, 08 Oct 2015 13:28:56 -0700 (PDT) In-Reply-To: <20151008184939.GW25574@eeg.ccf.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::232 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11596 > 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