All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gioele Barabucci <gioele@svario.it>
To: dash@vger.kernel.org
Subject: Sourcing an empty files does not reset exit status
Date: Tue, 17 Nov 2015 03:18:53 +0100	[thread overview]
Message-ID: <n2e2qe$voq$1@ger.gmane.org> (raw)

Hello,

a bug has been filed in the Debian BTS about dash not resetting the exit 
status after sourcing an empty file with the dot command. [1]

The following test echoes "OK" with bash and "fail" with dash

     #!/bin/sh

     echo > ./empty
     false

     . ./empty && echo "OK" || echo "fail"

A similar bug in dash has been discussed and addressed in 2011 [2], but 
it looks like the solution has been only partial.

The version of dash I tested is the current git master branch, commit 
2e58422.

[1] https://bugs.debian.org/777262
[2] http://article.gmane.org/gmane.comp.shells.dash/531

Regards,

--
Gioele Barabucci <gioele@svario.it>


             reply	other threads:[~2015-11-17  2:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17  2:18 Gioele Barabucci [this message]
2015-12-05 15:40 ` Sourcing an empty files does not reset exit status Harald van Dijk
2016-06-06 10:13   ` [PATCH] eval: Return status in eval functions Herbert Xu
2016-06-06 21:14     ` Harald van Dijk
2016-06-07  8:47       ` [PATCH v2] " 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='n2e2qe$voq$1@ger.gmane.org' \
    --to=gioele@svario.it \
    --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.