Reputation: 22113
Org's babel could export the stdtout to results
#+BEGIN_SRC shell
echo "testing "
#+END_SRC
#+RESULTS:
: testing
and report error to a new buffer or mini-buffer
#+BEGIN_SRC shell
e
#+END_SRC
#+RESULTS:
the error appear in a new buffer
/bin/bash: line 1: e: command not found
How could redirect the error to a #+RESULTS
?
Upvotes: 1
Views: 130
Reputation: 16054
You could redirect stderr to stdout.
#+BEGIN_SRC sh :prologue exec 2>&1
e
#+END_SRC
#+RESULTS:
: sh: 2: e: not found
You may also want to add :epilogue true
to suppress the [ Babel evaluation exited with code 127 ]
that may appear.
Upvotes: 0