emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Redirecting stderr to stdout with babel/shell


From: Karl Voit
Subject: [O] Redirecting stderr to stdout with babel/shell
Date: Thu, 1 Jan 2015 17:27:14 +0100
User-agent: slrn/pre1.0.0-18 (Linux)

Hi!

I enjoyed [1] where John is describing the issue of vanishing
stderr-messages through babel.

This could be fixed by "(setq org-babel-python-command "python -i -c
\"import sys; sys.stderr = sys.stdout\"")".

Is there a similar method to re-direct the stderr of a shell script
to stdout as well?

The issue is demonstrated below:

#+BEGIN_SRC sh :results output
echo "testing stdout" >&1
echo "testing stderr" >&2
echo "testing stderr with manual redirect" 2>&1 >&2
#+END_SRC

#+RESULTS:
: testing stdout
: testing stderr with manual redirect

I want to skip the manual redirect after each command.

Thanks for any idea!


[1] 
http://kitchingroup.cheme.cmu.edu/blog/2014/12/21/Capturing-stderr-from-Python-in-org-mode-take-2/

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




reply via email to

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