All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
To: dash@vger.kernel.org
Subject: Re: [PATCH] [EVAL] with set -e exit the shell if a subshell exits non-zero
Date: Mon, 28 Jun 2010 09:22:47 +0200 (CEST)	[thread overview]
Message-ID: <1006280909240.5913@somehost> (raw)
In-Reply-To: <20100628070231.GA26558@gondor.apana.org.au>

On Mon, 28 Jun 2010, Herbert Xu wrote:

> On Mon, Jun 14, 2010 at 09:56:03AM +0000, Gerrit Pape wrote:
> > Example:
> >
> > $ dash -c 'set -e; (false); echo here'
> > here
> >
> > With this commit, dash exits 1 before echo.
> >
> > The bug was reported by Stefan Fritsch through
> >  http://bugs.debian.org/514863
> >
> > Signed-off-by: Gerrit Pape <pape@smarden.org>
>
> I'm not convinced that this change is necessary.  I've run some
> tests and bash/pdksh both behave like dash, while ksh93 behaves
> in the way you suggest.
>
> Has bash's behaviour changed recently (I'm using an ancient
> version)?

bash 3.2.39 and 4.0.37 are behaving as dash without the suggested
patch.  Still.  What is the correct behaviour?  That should be the
essential matter IMO, not what others do.  So, why should this fail:

	$ dash -c 'set -e; false; echo here'

and this succeed?

	$ dash -c 'set -e; (false); echo here'

The subshell returns exit code 1, and errexit is set.  Why does dash
ignore that exit code in the later case?


Cheers,

-- 
Cristian

  reply	other threads:[~2010-06-28  7:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14  9:56 [PATCH] [EVAL] with set -e exit the shell if a subshell exits non-zero Gerrit Pape
2010-06-28  7:02 ` Herbert Xu
2010-06-28  7:22   ` Cristian Ionescu-Idbohrn [this message]
2010-06-28 13:16     ` Eric Blake
2010-07-05  8:26       ` Herbert Xu
2010-07-06  9:51 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1006280909240.5913@somehost \
    --to=cristian.ionescu-idbohrn@axis.com \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.