From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Steven Tilley" Subject: Buggy output in bash session Date: Wed, 27 Feb 2019 16:47:55 -0500 Message-ID: Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:53249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gz73M-0000bR-1h for emacs-orgmode@gnu.org; Wed, 27 Feb 2019 16:47:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gz73L-0001v6-4P for emacs-orgmode@gnu.org; Wed, 27 Feb 2019 16:47:48 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:53295) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gz73K-0001ud-Uj for emacs-orgmode@gnu.org; Wed, 27 Feb 2019 16:47:47 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id C15A6344C for ; Wed, 27 Feb 2019 16:47:45 -0500 (EST) 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" To: emacs-orgmode@gnu.org Hello, I posted this on stackoverflow [1], and they suggested I post it here. Any help would be greatly appreciated. I've noticed in org-babel when using a bash session with multiline statements (e.g. a for loop), the output contains extra characters (specifically ">"s and the prompt. The output can also change throughout the session. An example is below. I found this link, which is probably related, but I'm not sure. I'm relatively new to emacs/org, so digging into the internals is a little beyond me at this point. Thanks! No session -> correct output #+BEGIN_SRC bash :results output for i in 1 2 3 do echo $i done #+END_SRC #+RESULTS: : 1 : 2 : 3 Session -> Incorrect output #+BEGIN_SRC bash :session test_session :results output for i in 1 2 3 do echo $i done #+END_SRC #+RESULTS: : : > > > 1 : 2 : 3 Running the same command in the same session, and the output changes #+BEGIN_SRC bash :session test_session :results output for i in 1 2 3 do echo $i done #+END_SRC #+RESULTS: : : > > 1 : 2 : 3 New session, but loop is all one one line -> incorrect output #+BEGIN_SRC bash :session test_session2 :results output for i in 1 2 3; do echo $i; done #+END_SRC #+RESULTS: : : 1 : 2 : 3 Thanks Steve [1] https://stackoverflow.com/questions/54909018/org-babel-bash-output-with-sessions