emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] current directory and remote execution
@ 2010-03-03 23:25 Dan Davison
  0 siblings, 0 replies; only message in thread
From: Dan Davison @ 2010-03-03 23:25 UTC (permalink / raw)
  To: emacs org-mode mailing list

A quick note about a new org-babel feature:

You can now use header argument :dir to alter the directory that is
current when code is executed. The directory may be a location on a
remote machine, specified using tramp syntax[1]. In this case the code
will be executed on the remote machine.

If a relative path for file output is supplied using :file, then it will
be interpreted relative to the altered current directory. But while file
output may be created on a remote machine, numeric/text results are
returned to the local buffer as normal.

The :dir header arg will affect most languages; retrieval of remote
results is currently available for shell, R, ruby, python, perl and
clojure. New sessions can use :dir (and can be remote), but pre-existing
sessions are currently unaffected by :dir.

Here's an example of running code remotely:

#+begin_src sh :dir /davison@oak.somewhere.uk:/tmp :results output
echo "Executed by `whoami` on `hostname` in `pwd`"
#+end_src

#+results:
: Executed by davison on oak in /tmp

And here's an example of mixing a relative :file path with :dir

#+begin_src R :file images/1.png :dir ~/project
plot(1:10)
#+end_src

#+results:
[[file:/home/dan/project/images/1.png]]

Further documentation at [2].

Dan

Footnotes:

[1] http://www.gnu.org/software/tramp/#Filename-Syntax

[2] http://orgmode.org/worg/org-contrib/babel/reference.php#header-argument-dir

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-03 23:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-03 23:25 [babel] current directory and remote execution Dan Davison

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).