emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Calling source blocks with arguments
@ 2011-03-23 21:56 Philipp Haselwarter
  2011-03-28 15:19 ` Philipp Haselwarter
  2011-03-29 13:59 ` Eric Schulte
  0 siblings, 2 replies; 5+ messages in thread
From: Philipp Haselwarter @ 2011-03-23 21:56 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-29 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-23 21:56 [babel] Calling source blocks with arguments Philipp Haselwarter
2011-03-28 15:19 ` Philipp Haselwarter
2011-03-28 15:27   ` Rainer M Krug
2011-03-28 15:37   ` Eric S Fraga
2011-03-29 13:59 ` Eric Schulte

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).