From: Daniel Herzig <daniel.herzig@outlook.at>
To: Orgmode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: passing string to sh source code block
Date: Sat, 16 Mar 2019 13:07:25 +0000 [thread overview]
Message-ID: <DB7PR06MB467923AABA6606934D3F819086450@DB7PR06MB4679.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <878sxfdlzi.fsf@outlook.at> (Daniel Herzig's message of "Sat, 16 Mar 2019 13:47:45 +0100")
Sorry, I found my mistake. I'll post it anyway, maybe it's of use to
someone.
My path contains spaces, so I had to change the code a bit (see below).
Daniel Herzig <daniel.herzig@outlook.at> writes:
> Hi!
>
> I am trying to pass a path to an org-source-codeblock using the :var tag
> in the header:
>
> #+BEGIN_SRC sh :var directory="/x/y/z"
> cd directory
> ls
> #+END_SRC
#+BEGIN_SRC sh :var directory="/x/y/z"
cd "$directory"
ls
#+END_SRC
Like this it works as needed.
> The output of the ls command shows that I obviously stay in the location
> of my .org file (not "/x/y/z") -- is there a way to pass the path to the source
> codeblock, without having to enter the path inside the block?
>
> Any hint appreciated, thanks in advance,
>
> cheers,
> Daniel
next parent reply other threads:[~2019-03-16 13:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <878sxfdlzi.fsf@outlook.at>
2019-03-16 13:07 ` Daniel Herzig [this message]
2019-03-16 12:47 passing string to sh source code block Daniel Herzig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB7PR06MB467923AABA6606934D3F819086450@DB7PR06MB4679.eurprd06.prod.outlook.com \
--to=daniel.herzig@outlook.at \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).