From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [babel] Executing source block which includes another block Date: Thu, 10 Dec 2009 11:20:48 -0500 Message-ID: <87vdge3in3.fsf@stats.ox.ac.uk> References: <87k4wudhe8.fsf@missioncriticalit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIllH-0006JU-EF for emacs-orgmode@gnu.org; Thu, 10 Dec 2009 11:21:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIllC-0006Dg-Di for emacs-orgmode@gnu.org; Thu, 10 Dec 2009 11:21:02 -0500 Received: from [199.232.76.173] (port=47461 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIllC-0006DO-76 for emacs-orgmode@gnu.org; Thu, 10 Dec 2009 11:20:58 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:59196) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIllC-0007x7-Dy for emacs-orgmode@gnu.org; Thu, 10 Dec 2009 11:20:58 -0500 In-Reply-To: <87k4wudhe8.fsf@missioncriticalit.com> (Francesco Pizzolante's message of "Thu, 10 Dec 2009 15:37:35 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Francesco Pizzolante Cc: mailing-list-org-mode Francesco Pizzolante writes: > Hi, > > Here's a small example where I'm interested both in tangling source blocks and > executing sources blocks in my org buffer: > > * Test > > ** Common part > > #+srcname: common > #+begin_src sh :exports none :results silent > VAR=ThisIsATest > #+end_src > > ** My shell script > > #+srcname: script > #+begin_src sh :exports results :tangle my-script > <> > date > echo $VAR > #+end_src > > > When I tangle the script block, I correctly get the following my-script.sh > file: > > #!/usr/bin/env sh > # generated by org-babel-tangle > # [[id:a0232b32-0b2c-4105-94ae-8c0f1ca67101][script]] > VAR=ThisIsATest > date > echo $VAR > # script ends here > > > When I try to execute (C-cC-c) the same script block I get the following > result: > > #+results: script > | "sh:" | "line" | "6:" | "syntax" | "error" | "near" | "unexpected" | "token" | "`newline'" | > | "sh:" | "line" | "6:" | "`<>'" | "" | "" | "" | "" | "" | > > The included <> block should also be executed when executing the > <