From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karl Voit Subject: Re: Redirecting stderr to stdout with babel/shell Date: Sun, 11 Jan 2015 11:54:30 +0100 Message-ID: <2015-01-11T11-53-02@devnull.Karl-Voit.at> References: <2015-01-01T17-23-41@devnull.Karl-Voit.at> Reply-To: Karl Voit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAGAm-0001r0-Rw for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 05:55:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAGAj-0001tP-LQ for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 05:55:08 -0500 Received: from plane.gmane.org ([80.91.229.3]:40463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAGAj-0001rn-EU for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 05:55:05 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YAGAi-00071L-B4 for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 11:55:04 +0100 Received: from friends.grml.info ([136.243.234.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Jan 2015 11:55:04 +0100 Received: from news1142 by friends.grml.info with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Jan 2015 11:55:04 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * John Kitchin 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 echo "testing stdout" >&1 echo "testing stderr" >&2 date -g #+END_SRC #+RESULTS: ... no stderr on stdout and date error message in second buffer Creating a wrapper-script similar as described in web-page above: #+BEGIN_SRC sh echo '#!/usr/bin/zsh { /usr/bin/zsh $1 } 2>&1' > ~/src/misc/zsh_stderr_redirected_to_stdout.sh chmod +x ~/src/misc/zsh_stderr_redirected_to_stdout.sh cd ~/bin ln -s ../src/misc/zsh_stderr_redirected_to_stdout.sh . #+END_SRC #+RESULTS: Setting the sh-command to this wrapper-script: #+BEGIN_SRC elisp (setq org-babel-sh-command "~/bin/zsh_stderr_redirected_to_stdout.sh") #+END_SRC #+RESULTS: : ~/bin/zsh_stderr_redirected_to_stdout.sh Re-testing status: #+BEGIN_SRC sh :results output echo "testing stdout" >&1 echo "testing stderr" >&2 date -g #+END_SRC #+RESULTS: ... no change except the second buffer for the date error message is empty. So it's actually worse than before. Trying with bash (as web-page did): #+BEGIN_SRC sh echo '#!/bin/bash { /bin/bash $1 } 2>&1' > ~/src/misc/bash_stderr_redirected_to_stdout.sh chmod +x ~/src/misc/bash_stderr_redirected_to_stdout.sh cd ~/bin ln -s ../src/misc/bash_stderr_redirected_to_stdout.sh . #+END_SRC #+RESULTS: Setting the sh-command to this wrapper-script: #+BEGIN_SRC elisp (setq org-babel-sh-command "~/bin/bash_stderr_redirected_to_stdout.sh") #+END_SRC #+RESULTS: : ~/bin/bash_stderr_redirected_to_stdout.sh Same result as with zsh :-( Re-setting to standard settings to revoke tests from above: #+BEGIN_SRC elisp (setq org-babel-sh-command "sh") #+END_SRC #+RESULTS: : sh Re-testing status: #+BEGIN_SRC sh :results output echo "testing stdout" >&1 echo "testing stderr" >&2 date -g #+END_SRC #+RESULTS: -- 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