From mboxrd@z Thu Jan 1 00:00:00 1970 From: "briangpowell ." Subject: Re: Scripting with org-mode Date: Mon, 30 Nov 2015 13:48:30 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013cb738c434790525c67c3c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3TV2-00013d-Fy for emacs-orgmode@gnu.org; Mon, 30 Nov 2015 13:48:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3TV1-0005FX-D9 for emacs-orgmode@gnu.org; Mon, 30 Nov 2015 13:48:32 -0500 Received: from mail-ob0-x22e.google.com ([2607:f8b0:4003:c01::22e]:33077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3TV1-0005Ez-7W for emacs-orgmode@gnu.org; Mon, 30 Nov 2015 13:48:31 -0500 Received: by obbww6 with SMTP id ww6so134950455obb.0 for ; Mon, 30 Nov 2015 10:48:30 -0800 (PST) In-Reply-To: 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: Shakthi Kannan Cc: emacs-orgmode --089e013cb738c434790525c67c3c Content-Type: text/plain; charset=UTF-8 * Assuming that entire file is made up of shell commands (like the ones in the example you gave) since, in such a case as your example the "#" in the first column would ignore the rest of the lines as comments: M< Mx set-mark M> Mx shell-command-on-region On Mon, Nov 30, 2015 at 11:43 AM, Shakthi Kannan wrote: > Hi, > > Is there a way to execute all the org-mode code blocks in a file, and > send the output to stdout? > > For example, I have the following org file: > > === BEGIN === > > * Greeting > > #+BEGIN_SRC sh :results output > echo "Hello $USER! Today is `date`" > #+END_SRC > > * Current directory > > #+BEGIN_SRC sh :results output > pwd > #+END_SRC > > === END === > > I could go to each code block, and type C-c C-c to produce an output. > But, I just want to be able to execute the entire file, and produce > one single output. > > Is this possible? > > SK > > -- > Shakthi Kannan > http://www.shakthimaan.com > > --089e013cb738c434790525c67c3c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
* Assuming that entire file is made up of shell comma= nds (like the ones in the example you gave) since, in such a case as your e= xample the "#" in the first column would ignore the rest of the l= ines as comments:

M<
Mx set-mark
M>
Mx shell-command-on-region=C2=A0

On Mon, Nov 30, 2015 at 11= :43 AM, Shakthi Kannan <shakthimaan@gmail.com> wrote:
Hi,

Is there a way to execute all the org-mode code blocks in a file, and
send the output to stdout?

For example, I have the following org file:

=3D=3D=3D BEGIN =3D=3D=3D

* Greeting

#+BEGIN_SRC sh :results output
=C2=A0 echo "Hello $USER! Today is `date`"
#+END_SRC

* Current directory

#+BEGIN_SRC sh :results output
=C2=A0 pwd
#+END_SRC

=3D=3D=3D END =3D=3D=3D

I could go to each code block, and type C-c C-c to produce an output.
But, I just want to be able to execute the entire file, and produce
one single output.

Is this possible?

SK

--
Shakthi Kannan
http://www.shakthimaan.com


--089e013cb738c434790525c67c3c--