From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski 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 Message-ID: <87k1awa1mn.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:43412) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3EZP-0001Cs-FZ for emacs-orgmode@gnu.org; Thu, 29 Aug 2019 03:10:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i3EZO-0004jR-8C for emacs-orgmode@gnu.org; Thu, 29 Aug 2019 03:10:11 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:48304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i3EZO-0004aj-1l for emacs-orgmode@gnu.org; Thu, 29 Aug 2019 03:10:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id EEA4CE69AD for ; Thu, 29 Aug 2019 09:10:00 +0200 (CEST) Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K53EavumCAgo for ; Thu, 29 Aug 2019 09:09:57 +0200 (CEST) Received: from localhost (83.25.101.23.ipv4.supernova.orange.pl [83.25.101.23]) by mail.mojserwer.eu (Postfix) with ESMTPSA id AB214E6322 for ; Thu, 29 Aug 2019 09:09:56 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" 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