Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-21 Thread Karl Voit
* Achim Gratz strom...@nexgo.de wrote: Karl Voit writes: However with an additional echo at the end: You need to understand what you're doing or at least copy the code exactly. The last line in my example is a colon : so that the shell exit code is always zero. You're right. The only

Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-11 Thread Karl Voit
* John Kitchin johnrkitc...@gmail.com wrote: Check out this solution: http://kitchingroup.cheme.cmu.edu/blog/2015/01/04/Redirecting-stderr-in-org-mode-shell-blocks/ Hm. This does not work on my machine: Debian Wheezy GNU/Linux Testing the current satus (again): #+BEGIN_SRC sh :results output

Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-11 Thread Achim Gratz
Karl Voit writes: echo testing stderr with manual redirect 21 2 The last redirection 2 is nonsense, it only works because STDERR is already reopened on STDOUT and redirection to the same file descriptor is ignored. And to solve your original problem: #+BEGIN_SRC sh :results output exec 21 echo

Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-11 Thread Karl Voit
* Achim Gratz strom...@nexgo.de wrote: Karl Voit writes: echo testing stderr with manual redirect 21 2 The last redirection 2 is nonsense, it only works because STDERR is already reopened on STDOUT and redirection to the same file descriptor is ignored. Absolutely right. Must have been a

Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-11 Thread John Kitchin
Karl Voit devn...@karl-voit.at writes: Weird. It works for me on MacOSX with bash. Out of curiosity, did you try the source: http://kitchingroup.cheme.cmu.edu/org/2015/01/04/Redirecting-stderr-in-org-mode-shell-blocks.org? I updated the web page with Achim's simpler solution. * John Kitchin

Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-11 Thread Karl Voit
* John Kitchin johnrkitc...@gmail.com wrote: Karl Voit devn...@karl-voit.at writes: Weird. It works for me on MacOSX with bash. Out of curiosity, did you try the source: http://kitchingroup.cheme.cmu.edu/org/2015/01/04/Redirecting-stderr-in-org-mode-shell-blocks.org? I did it now. What I

Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-11 Thread Achim Gratz
Karl Voit writes: However with an additional echo at the end: You need to understand what you're doing or at least copy the code exactly. The last line in my example is a colon : so that the shell exit code is always zero. If not, Babel will ignore the output since it interprets any non-zero

Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-04 Thread John Kitchin
Check out this solution: http://kitchingroup.cheme.cmu.edu/blog/2015/01/04/Redirecting-stderr-in-org-mode-shell-blocks/ I think it does what you want, and uses the idea below. Samuel Wales samolog...@gmail.com writes: hi karl, i always wrap as follows and it works for me. { your code

Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-02 Thread Samuel Wales
hi karl, i always wrap as follows and it works for me. { your code } 21 : the : eliminates fancy error handling. i find that much less confusing. samuel -- The Kafka Pandemic: http://thekafkapandemic.blogspot.com The disease DOES progress. MANY people have died from it. And ANYBODY

Re: [O] Redirecting stderr to stdout with babel/shell

2015-01-01 Thread Michael Brand
Hi Karl On Thu, Jan 1, 2015 at 5:27 PM, Karl Voit devn...@karl-voit.at wrote: Is there a similar method to re-direct the stderr of a shell script to stdout as well? Not that I know of an other way than what you already demonstrated. Once I wrote a lengthy post with my opinion about stdout,

[O] Redirecting stderr to stdout with babel/shell

2015-01-01 Thread Karl Voit
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