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

2019-06-06 Thread Christian Weisgerber
On 2019-06-05, Andreas Kusalananda Kähäri 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

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

2019-06-06 Thread Andreas Kusalananda Kähäri
On Wed, Jun 05, 2019 at 08:05:48PM +0200, Andreas Kusalananda Kähäri wrote: > When running under set -e, why does > > eval false || echo ok Just to clarify: OpenBSD's sh(1) and ksh(1) make it impossible to run code like set -e if eval "$string"; then echo ok else echo not ok fi

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

2019-06-05 Thread Andreas Kusalananda Kähäri
When running under set -e, why does eval false || echo ok terminate the script with the execution of eval? As far as I know, the OpenBSD sh(1) and ksh(1) shells are the only ones doing that. If we take termination of the script as a given in the above scenario (even if it feel a bit odd