emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* using variables with :dir
@ 2015-09-06  3:08 Arthur A. Gleckler
  2015-09-06  3:36 ` Kyle Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: Arthur A. Gleckler @ 2015-09-06  3:08 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

Is it possible to use variables with :dir?  For example, I've tried this,
but no substitution of ${SRFI} seems to happen:

#+BEGIN_SRC sh :dir ~/srfi/split/srfi-${SRFI} :results output silent
:session local
  git push
#+END_SRC

Thanks.

[-- Attachment #2: Type: text/html, Size: 471 bytes --]

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

* Re: using variables with :dir
  2015-09-06  3:08 using variables with :dir Arthur A. Gleckler
@ 2015-09-06  3:36 ` Kyle Meyer
  2015-09-06  4:17   ` Arthur A. Gleckler
  0 siblings, 1 reply; 3+ messages in thread
From: Kyle Meyer @ 2015-09-06  3:36 UTC (permalink / raw)
  To: Arthur A. Gleckler; +Cc: emacs-orgmode

"Arthur A. Gleckler" <org@speechcode.com> writes:

> Is it possible to use variables with :dir?  For example, I've tried this,
> but no substitution of ${SRFI} seems to happen:
>
> #+BEGIN_SRC sh :dir ~/srfi/split/srfi-${SRFI} :results output silent
> :session local
>   git push
> #+END_SRC

There may be a better way, but this seems to work.

#+begin_src sh :dir (substitute-in-file-name "$HOME/.emacs.d/") :results output
  ls | tail -2
#+end_src

#+RESULTS:
: tramp
: url

--
Kyle

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

* Re: using variables with :dir
  2015-09-06  3:36 ` Kyle Meyer
@ 2015-09-06  4:17   ` Arthur A. Gleckler
  0 siblings, 0 replies; 3+ messages in thread
From: Arthur A. Gleckler @ 2015-09-06  4:17 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 554 bytes --]

On Sat, Sep 5, 2015 at 8:36 PM, Kyle Meyer <kyle@kyleam.com> wrote:


> There may be a better way, but this seems to work.
>
> #+begin_src sh :dir (substitute-in-file-name "$HOME/.emacs.d/") :results
> output
>   ls | tail -2
> #+end_src
>
> #+RESULTS:
> : tramp
> : url
>
> Thanks.  While that does substitute for $HOME, it doesn't substitute for
$SRFI, which isn't in Emacs's process environment.

I've found a way to work around it.  I don't use :dir at all:

#+BEGIN_SRC sh :results output silent
  cd ~/srfi/split/srfi-${SRFI}/
  git push
#+END_SRC

[-- Attachment #2: Type: text/html, Size: 1290 bytes --]

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

end of thread, other threads:[~2015-09-06  4:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-06  3:08 using variables with :dir Arthur A. Gleckler
2015-09-06  3:36 ` Kyle Meyer
2015-09-06  4:17   ` Arthur A. Gleckler

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