emacs-orgmode
[Top][All Lists]
Advanced

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

Re: How to intersperse commands with their output in RESULTS block?


From: Diego Zamboni
Subject: Re: How to intersperse commands with their output in RESULTS block?
Date: Thu, 6 Feb 2020 21:45:19 +0100

Hi Eric,

Great idea! I hadn't considered using the =script= command, it's a great starting point.

Thanks!
--Diego


On Thu, Feb 6, 2020 at 7:55 AM Fraga, Eric <address@hidden> wrote:
On Wednesday,  5 Feb 2020 at 18:25, Diego Zamboni wrote:
> tl;dr: is there a way to have ob-shell (or some similar mode) run commands
> one by one and include the commands, interspersed with their output, in the
> #+RESULTS block?

You haven't said on what type of system but, if Linux, you could try
using =script= as a starting point:

#+begin_src shell :results output
  script <<EOF
  ls
  echo 'hello'
  EOF
#+end_src

You may wish to have a second shell script that massages the output in
the =typescript= file and ouputs that instead, e.g. to filter the
carriage returns.
--
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.2-233-gc2bc48

reply via email to

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