[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Revisiting Error handling (errexit)
From: |
Yair Lenga |
Subject: |
Re: Revisiting Error handling (errexit) |
Date: |
Wed, 6 Jul 2022 16:53:34 +0300 |
Koichi - Thanks for highlighting this 'local -'.
This feature effectively eliminates the need to support scoped 'errfail'.
If it's needed in a limited context, the 'local -' can be used.
Yair
On Wed, Jul 6, 2022 at 1:21 PM Koichi Murase <myoga.murase@gmail.com> wrote:
> 2022年7月6日(水) 19:05 Yair Lenga <yair.lenga@gmail.com>:
> > Function foo will run with errfail logic. But bash will revert back to no
> > errfail when control revert back to bar, and zap will run WITHOUT
> errfail.
> > I remember reading about other bash setting that are automatically
> restored
> > on function exits. Can not remember which one.
>
> That should be `local -' of Bash 4.4+. E.g.,
>
> function foo { local -; set -e; ...; }
>
> --
> Koichi
>
- Re: Revisiting Error handling (errexit), (continued)
- Re: Revisiting Error handling (errexit), Yair Lenga, 2022/07/05
- Re: Revisiting Error handling (errexit), Lawrence Velázquez, 2022/07/05
- Re: Revisiting Error handling (errexit), Yair Lenga, 2022/07/05
- Re: Revisiting Error handling (errexit), Lawrence Velázquez, 2022/07/05
- Re: Revisiting Error handling (errexit), Yair Lenga, 2022/07/05
- Re: Revisiting Error handling (errexit), Lawrence Velázquez, 2022/07/05
- Re: Revisiting Error handling (errexit), Martin D Kealey, 2022/07/06
- Re: Revisiting Error handling (errexit), Yair Lenga, 2022/07/06
- Re: Revisiting Error handling (errexit), Koichi Murase, 2022/07/06
- Re: Revisiting Error handling (errexit),
Yair Lenga <=
- Re: Revisiting Error handling (errexit), Koichi Murase, 2022/07/06
- Re: Revisiting Error handling (errexit), Martin D Kealey, 2022/07/05
- Re: Revisiting Error handling (errexit), Robert Elz, 2022/07/06