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 19:31:00 +0100 Message-ID: <2015-01-11T19-20-47@devnull.Karl-Voit.at> References: <2015-01-01T17-23-41@devnull.Karl-Voit.at> <2015-01-11T11-53-02@devnull.Karl-Voit.at> Reply-To: Karl Voit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YANIK-0000Gl-VO for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 13:31:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YANIH-0005Xz-6q for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 13:31:24 -0500 Received: from plane.gmane.org ([80.91.229.3]:55309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YANIH-0005Xv-0E for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 13:31:21 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YANIE-0005pU-I0 for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 19:31:18 +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 19:31:18 +0100 Received: from news1142 by friends.grml.info with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Jan 2015 19:31:18 +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: > Karl Voit 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 found out: #+BEGIN_SRC sh echo '#!/usr/bin/zsh { /usr/bin/zsh $1 } 2>&1 #end' > ~/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 #+BEGIN_SRC elisp (setq org-babel-sh-command "~/bin/zsh_stderr_redirected_to_stdout.sh") #+END_SRC ... my old script from my previous posting: #+BEGIN_SRC sh :results output echo "testing stdout" >&1 echo "testing stderr" >&2 date -g #+END_SRC #+RESULTS: ... with empty additional buffer window. So not happy. However with an additional "echo" at the end: #+BEGIN_SRC sh :results output echo "testing stdout" >&1 echo "testing stderr" >&2 date -g echo #+END_SRC #+RESULTS: : testing stdout : testing stderr : date: invalid option -- 'g' : Try `date --help' for more information. : ... it works. :-O Is there an issue with flushing stdout or something? What is the explanation and the general rule? Btw, the trick with tangling for writing the script file did not work on my machine. -- 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