Thursday, June 06, 2019

Re: Behaviour of eval in sh(1) and ksh(1) in AND-OR list with set -e

On 2019-06-05, Andreas Kusalananda Kähäri <andreas.kahari@abc.se> wrote:

> When running under set -e, why does
> eval false || echo ok
> terminate the script with the execution of eval?

I think that's a bug.

> then why does the below behave differently?
> eval ! true || echo ok

That's actually the documented, POSIX-specified behavior. Somewhat
bizarrely, ! disables errexit. The eval doesn't matter here.

--
Christian "naddy" Weisgerber naddy@mips.inka.de

No comments:

Post a Comment