From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philipp Haselwarter Subject: [babel] Calling source blocks with arguments Date: Wed, 23 Mar 2011 22:56:53 +0100 Message-ID: <878vw58pqy.fsf@nzebook.haselwarter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=33323 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2gsD-0005m2-DX for emacs-orgmode@gnu.org; Thu, 24 Mar 2011 05:30:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2grp-00089n-P0 for emacs-orgmode@gnu.org; Thu, 24 Mar 2011 05:30:10 -0400 Received: from lo.gmane.org ([80.91.229.12]:49969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2grp-00089j-JS for emacs-orgmode@gnu.org; Thu, 24 Mar 2011 05:30:09 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q2grl-00076r-FE for emacs-orgmode@gnu.org; Thu, 24 Mar 2011 10:30:05 +0100 Received: from 78.114.102.119 ([78.114.102.119]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Mar 2011 10:30:05 +0100 Received: from philipp.haselwarter by 78.114.102.119 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Mar 2011 10:30:05 +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: emacs-orgmode@gnu.org Hi, Is there a way to call a source-block with (positional) arguments, like one would do on the command line? I want to include some shell scripts in a paper and would prefer not having to introduce some kind of artificial variables. So I could just write my scripts inline, like #+srcname: script.sh #+begin_src sh #!/bin/sh echo $0: $@ #+end_src and demonstrate their output by calling them #+call: script.sh("arg1", "arg2") :results output would produce something like #+results: : script.sh: arg1 arg2 Can this be done? PS: Is there a way to set «:results output» for the whole file? thanks, -- Philipp Haselwarter