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 documented,

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 whe

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 sin

Re: [[ in sh(1)

2007-07-19 Thread Nick Guenther
On 7/17/07, Paul de Weerd <[EMAIL PROTECTED]> wrote: On Tue, Jul 17, 2007 at 11:42:14AM -0400, Eric Furman wrote: | > The description of [[ ]] is missing from sh(1) though, hence my | > statement "which, I believe, is only a difference in documentation". | This difference is only in the document

Re: [[ in sh(1)

2007-07-17 Thread Stuart Henderson
On 2007/07/17 19:37, frantisek holop wrote: > hmm, on Tue, Jul 17, 2007 at 11:42:14AM -0400, Eric Furman said that > > [[ is not listed in sh(1) because this construct doesn't exist in sh(1). > > There is a difference in the [[ construct in ksh. Read man ksh(1). > > righ

Re: [[ in sh(1)

2007-07-17 Thread frantisek holop
hmm, on Tue, Jul 17, 2007 at 11:42:14AM -0400, Eric Furman said that > [[ is not listed in sh(1) because this construct doesn't exist in sh(1). > There is a difference in the [[ construct in ksh. Read man ksh(1). right, thanks for the answers. but is it supposed to be listed in sh(1

Re: [[ in sh(1)

2007-07-17 Thread Paul de Weerd
a difference in documentation". | | [[ is not listed in sh(1) because this construct doesn't exist in sh(1). | There is a difference in the [[ construct in ksh. Read man ksh(1). | Most significantly; | o Field splitting and file name generation are not per- | formed on arguments. | o

Re: [[ in sh(1)

2007-07-17 Thread Eric Furman
fferent things depending on whether it's run as ksh or sh. > > As far as my quick test (not definitive by any means) shows, it does > not do anything different with respect to handling [[ ]]. > > The description of [[ ]] is missing from sh(1) though, hence my > statement

Re: [[ in sh(1)

2007-07-17 Thread Paul de Weerd
On Tue, Jul 17, 2007 at 03:27:51PM +0100, Stuart Henderson wrote: | > My manpage (ksh(1)) says : | > | > [[ expression ]] | > Similar to the test and [ ... ] commands (described later), with | > the following exceptions: | > | > And then lists some exceptions. This

Re: [[ in sh(1)

2007-07-17 Thread Stuart Henderson
On 2007/07/17 16:07, Paul de Weerd wrote: > On Tue, Jul 17, 2007 at 03:42:53PM +0200, frantisek holop wrote: > | i have found a script on hp-ux that uses > | [[ ]] instead of the if [ ]; then construct > | so i went to sh(1), and while [[ is listed > | as a compound command, i couldn't find any > |

Re: [[ in sh(1)

2007-07-17 Thread Paul de Weerd
On Tue, Jul 17, 2007 at 03:42:53PM +0200, frantisek holop wrote: | i have found a script on hp-ux that uses | [[ ]] instead of the if [ ]; then construct | so i went to sh(1), and while [[ is listed | as a compound command, i couldn't find any | explanation of what it does and how is it | different

Re: [[ in sh(1)

2007-07-17 Thread Stuart Henderson
On 2007/07/17 15:42, frantisek holop wrote: > so i went to sh(1), and while [[ is listed see ksh(1)

[[ in sh(1)

2007-07-17 Thread frantisek holop
hi there, i have found a script on hp-ux that uses [[ ]] instead of the if [ ]; then construct so i went to sh(1), and while [[ is listed as a compound command, i couldn't find any explanation of what it does and how is it different if at all. could the doc experts advise please and update the do