emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Buggy output in bash session


From: Steven Tilley
Subject: [O] Buggy output in bash session
Date: Wed, 27 Feb 2019 16:47:55 -0500
User-agent: Cyrus-JMAP/3.1.5-895-g0d23ba6-fmstable-20190213v1

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]