Re: [O] ob-shell, output and continuation prompts
Hi, A similar issue - a code block and the result below would be normal. #+BEGIN_SRC shell echo $PWD #+END_SRC #+Results: : /Users/shin/Documents However, when I specified a session name, the first evaluation returns a table-format value as below, ... #+BEGIN_SRC shell :session *shell* echo $PWD #+END_SRC #+Results: | | | /Users/shin/Documents | ... but, the second or more latter evaluations return the normal value. #+BEGIN_SRC shell :session *shell* echo $PWD #+END_SRC #+Results: : /Users/shin/Documents ... How can I get the normal value in all evaluations of the session? I attached the session log in the *shell* buffer below. I am using Org mode version 9.1.6 (9.1.6-16-g86a382-elpaplus @ /Users/shin/.emacs.d/elpa/org-plus-contrib-20180115/ on macOS. Regards, Shintaro echo $PWD bash-3.2$ /Users/shin/Documents bash-3.2$ echo 'org_babel_sh_eoe' org_babel_sh_eoe bash-3.2$ echo $PWD /Users/shin/Documents bash-3.2$ echo 'org_babel_sh_eoe' org_babel_sh_eoe bash-3.2$ On Tue, Nov 28, 2017 at 1:25 PM Michael Wellewrote: > Hello, > > this code block: > > #+BEGIN_SRC shell :session n42 :shebang "#!/bin/bash" > for i in "aa" "bb" "cc" ; do > echo "u: $i" > done > #+end_src > > produces this output when it first runs: > > #+RESULTS: > ||||| > | > | > | u: | aa | > | u: | bb ||| > | u: | cc ||| > > > After the first run, subsequent runs produce this output: > > #+RESULTS: > |||| > | > | u: | aa | > | u: | bb || > | u: | cc || > > If I set :session to none the output is always like follows: > > #+RESULTS: > | u: | aa | > | u: | bb | > | u: | cc | > > > I think that last one is what one would expect ;). Anyways, using sessions, > is there a way to get rid off of the shell's continuation prompts? > > Regards > hmw > >
Re: [O] ob-shell, output and continuation prompts
Hello, Michael Wellewrites: > Hello Eric, > > Eric S Fraga writes: > >> On Tuesday, 28 Nov 2017 at 13:23, Michael Welle wrote: >>> I think that last one is what one would expect ;). Anyways, using sessions, >>> is there a way to get rid off of the shell's continuation prompts? >> >> PS2="" >> >> in the shell script? > does that work for you? I had to evaluate > (add-to-list 'tramp-remote-process-environment "PS2=> "). Otherwise > tramp/emacs would wait forever after sending the first line of the for > loop. oh, I should add that. Albeit the example I posted earlier runs locally, my goal is to execute the shell code on a remote machine. But the result is the same with both scenarios. #+BEGIN_SRC shell :session n42 :dir /localhost: :shebang "#!/bin/bash" for i in "aa" "bb" "cc" ; do echo "u: $i" done #+end_src Regards hmw
Re: [O] ob-shell, output and continuation prompts
Hello Eric, Eric S Fragawrites: > On Tuesday, 28 Nov 2017 at 13:23, Michael Welle wrote: >> I think that last one is what one would expect ;). Anyways, using sessions, >> is there a way to get rid off of the shell's continuation prompts? > > PS2="" > > in the shell script? does that work for you? I had to evaluate (add-to-list 'tramp-remote-process-environment "PS2=> "). Otherwise tramp/emacs would wait forever after sending the first line of the for loop. Regards hmw
Re: [O] ob-shell, output and continuation prompts
On Tuesday, 28 Nov 2017 at 13:23, Michael Welle wrote: > I think that last one is what one would expect ;). Anyways, using sessions, > is there a way to get rid off of the shell's continuation prompts? PS2="" in the shell script? -- Eric S Fraga via Emacs 27.0.50, Org release_9.1.3-168-g7455f4 signature.asc Description: PGP signature