emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Capturing the results of shell execution


From: Alex Bennée
Subject: [O] Capturing the results of shell execution
Date: Tue, 17 Jan 2017 15:05:29 +0000
User-agent: mu4e 0.9.19; emacs 25.1.91.2

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]