From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Bug: babel: results switch (output vs. value) has no or wrong effect for sh source block [7.7 (release_7.7.107.g7a82)] Date: Fri, 19 Aug 2011 07:33:54 -0600 Message-ID: <87pqk1o39w.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuQYC-00082k-TF for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 11:00:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QuQYB-00065R-2k for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 11:00:00 -0400 Received: from mail-yi0-f41.google.com ([209.85.218.41]:47543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuQYB-00064t-0B for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 10:59:59 -0400 Received: by yib2 with SMTP id 2so2467126yib.0 for ; Fri, 19 Aug 2011 07:59:58 -0700 (PDT) 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: Andras Major Cc: emacs-orgmode@gnu.org Andras Major writes: > Hello, here is an example of apparently erroneous behaviour of the > :results switch. In this example, we use an sh block, but it also > appears to affect other languages (will need more investigation). > > Example Org code: > > #+begin_src sh :exports output > echo "Hello World 1" > #+end_src > > #+results: > : Hello World 1 > > #+begin_src sh :exports value > echo "Hello World 2" > #+end_src > > #+results: > : Hello World 2 > > Am I missing something here or should the second instance really > output something like an integer exit value from echo? > Hi Andr=C3=A1s, If we did return the value of shell scripts then ":results value" would almost always simply return 0 (or possibly an error message). For this reason shell code blocks do not implement value returns, but rather will always collect results from STDOUT. Best -- Eric --=20 Eric Schulte http://cs.unm.edu/~eschulte/