all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Can I get the results of shell code block when exit code is non-zero?
@ 2019-08-29  7:09 Marcin Borkowski
  2019-08-29 16:13 ` Michaël Cadilhac
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Borkowski @ 2019-08-29  7:09 UTC (permalink / raw)
  To: Org-Mode mailing list

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-29 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-29  7:09 Can I get the results of shell code block when exit code is non-zero? Marcin Borkowski
2019-08-29 16:13 ` Michaël Cadilhac

Code repositories for project(s) associated with this external index

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

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.