help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] errexit and attempting to change readonly functions


From: David
Subject: Re: [Help-bash] errexit and attempting to change readonly functions
Date: Sat, 28 Sep 2019 00:33:08 +1000

On Fri, 27 Sep 2019 at 23:18, Andreas Kusalananda Kähäri
<address@hidden> wrote:

> What's the rationale behind this, or is it a bug?  Or did I simply miss
> some text in the manual?

Hi, it might be a bug. But more usefully for you, I will tell you
what I have learned from people with more knowledge than
I have ...

set -e is an old, outdated approach to error handling that has
many pitfalls. Different people have different opinions about
whether using set -e is a good idea. [1][2]

The people I have seen recommending to use set -e seem to make the
case that using it is better than doing no error handling at all. But
I get the impression that the use case doesn't go much deeper than
that. Whereas people I have seen recommending to NOT use set -e seem
to have many convincing reasons why it is a bad idea.

So my answer to your question is: "learn how to do error handling
properly without using set -e, and then (like us) you won't care
about the question you asked".

There are lots of very capable programmers on this mailing list and I
expect they will speak up if they disagree with my advice, and educate
both of us.

You can read more here:
[1] http://mywiki.wooledge.org/BashFAQ/105
[2] https://fvue.nl/wiki/Bash:_Error_handling



reply via email to

[Prev in Thread] Current Thread [Next in Thread]