help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] set -e when using traps recommend?


From: DJ Mills
Subject: Re: [Help-bash] set -e when using traps recommend?
Date: Sun, 12 Aug 2012 15:42:18 -0400

On Sun, Aug 12, 2012 at 10:52 AM, adrelanos <address@hidden> wrote:
> Hi,
>
> should I use set -e anyway even if I am already using traps?
>
> Cheers,
> adrelanos
>

In my opinion, you should never use set -e. Check exit statuses
yourself when you need to.

But what traps? an ERR trap? then definitely not. If you're using an
EXIT trap to clean up,
though, errexit could be used. It really all depends on what you're
doing with the traps.

Also, you should give this a look:
http://mywiki.wooledge.org/BashFAQ/105



reply via email to

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