emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Org-Mode mailing list <emacs-orgmode@gnu.org>
Subject: Can I get the results of shell code block when exit code is non-zero?
Date: Thu, 29 Aug 2019 09:09:52 +0200	[thread overview]
Message-ID: <87k1awa1mn.fsf@mbork.pl> (raw)

Hi all,

apparently when the exit code of the last command in a shell code block
is not zero, I do not get the results.  This doesn't seem to be
documented in the manual (though I might be missing something).  Check
this:

#+begin_src bash :results verbatim
  echo hello world
  exit 0
#+end_src

and this:

#+begin_src bash :results verbatim
  echo hello world
  exit 1
#+end_src

How can I tell Org to put the results in the file anyway?  My use case
is =diff=, which exists with status 1 if differences are found, and this
is a blog post, so I do not want to pollute the post with an =exit 0= at
the end of the code snippet.

TIA,

-- 
Marcin Borkowski
http://mbork.pl

             reply	other threads:[~2019-08-29  7:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29  7:09 Marcin Borkowski [this message]
2019-08-29 16:13 ` Can I get the results of shell code block when exit code is non-zero? Michaël Cadilhac

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87k1awa1mn.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=emacs-orgmode@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).