emacs-orgmode
[Top][All Lists]
Advanced

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

[O] [BABEL] Redirect stderr to stdout?


From: Viktor Rosenfeld
Subject: [O] [BABEL] Redirect stderr to stdout?
Date: Fri, 2 Mar 2012 12:29:09 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

is there a way to capture stderr output of a babel block and have it
appear in the results block (instead of being printed in the *Shell
Command Output* buffer)? On sh blocks I could redirect myself, but I'm
trying to capture the output of psql (the PostgreSQL client).

Specifically, I have the following code block:

#+BEGIN_SRC sql :noweb yes :results output verbatim
\timing on
<<exp8-test-query>>
#+END_SRC

#+RESULTS:
: count
: 95977

The \timing directive causes psql to print the runtime of the query on
stderr. If I run the query on the psql command line, the following
output appears:

 count 
 -------
 95977
 (1 row)

 Time: 1895,558 ms

I suppose that duplicating this output in Babel would be difficult,
because it interferes with the parsing of the result set.

Cheers,
Viktor



reply via email to

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