From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex =?utf-8?Q?Benn=C3=A9e?= Subject: Capturing the results of shell execution Date: Tue, 17 Jan 2017 15:05:29 +0000 Message-ID: <87vatdu3pi.fsf@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTVKL-0000At-Lp for emacs-orgmode@gnu.org; Tue, 17 Jan 2017 10:05:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTVKH-00048l-LS for emacs-orgmode@gnu.org; Tue, 17 Jan 2017 10:05:37 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:38477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTVKH-00048d-6J for emacs-orgmode@gnu.org; Tue, 17 Jan 2017 10:05:33 -0500 Received: by mail-wm0-x236.google.com with SMTP id r144so226690367wme.1 for ; Tue, 17 Jan 2017 07:05:33 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o132sm37465998wmo.17.2017.01.17.07.05.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 07:05:30 -0800 (PST) Received: from zen (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTPS id B3D493E0189 for ; Tue, 17 Jan 2017 15:05:29 +0000 (GMT) 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: emacs-orgmode@gnu.org I'm using org-babel snippets to automate some of my workflow. However I'm not interested in dumping all of the compile output, I'd rather get a simple value at the end to see if all was OK: #+name: build-test #+begin_src sh :results value set -e ./configure --cross-prefix=aarch64-linux-gnu- --arch=arm64 make clean make -j9 #+end_src However there isn't a way to tell the difference between a failing sequence and a passing one apart from *Org-Babel Error Output* being popped up. It seems org-babel-eval just slurps up the return code and blindly returns (buffer-string) regardless of the desires of the :results keyword. Is this an intentional limitation of babels sh evaluation? Redirecting all the compile output in the snippet seems a little clumsy a solution: #+name: build-test #+begin_src sh :results output set -e ./configure --cross-prefix=aarch64-linux-gnu- --arch=arm64 make clean > /dev/null make -j9 > /dev/null echo "Build complete: `date`" #+end_src Ideally I'd like #+RESULTS to have a nice 0/1 which can be used to gate other parts of the process. Am I missing something? -- Alex Bennée