[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Can I get the results of shell code block when exit code is non-zero
From: |
Marcin Borkowski |
Subject: |
[O] Can I get the results of shell code block when exit code is non-zero? |
Date: |
Thu, 29 Aug 2019 09:09:52 +0200 |
User-agent: |
mu4e 1.1.0; emacs 27.0.50 |
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
- [O] Can I get the results of shell code block when exit code is non-zero?,
Marcin Borkowski <=