emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: sergio ruiz <sergio.rrd@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [org-babel] String interpolation using shell
Date: Thu, 9 Jan 2020 11:56:19 -0500	[thread overview]
Message-ID: <203196E9-AE09-4760-AF38-3D08D4622935@gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1180 bytes --]

Hey, all.

I am trying to set a string at the head of the file and use it in different places in the file.

Everything works correctly for somethign like ruby, but I am not sure how do do this with a shell command.

Just sets the string to the url
#+NAME: url_name
#+BEGIN_SRC ruby
"http://www.google.com"
#+END_SRC

#+RESULTS: url_name
: http://www.google.com

#+BEGIN_SRC ruby :var url_input=url_name
url_input
#+END_SRC

#+RESULTS:
: http://www.google.com

^^ This seems to work fine.

#+BEGIN_SRC shell :var url_input=url_name
  curl url_input
#+END_SRC

#+RESULTS:

^^ This doesn't work. It is trying to use "url_input" in the curl command.

#+BEGIN_SRC shell
  curl {url_input}
#+END_SRC

#+RESULTS:

^^ this doesn't work. It is trying to use "url_input" in the curl command.

Thanks!

----
peace,
sergio
photographer, journalist, visionary

Public Key: https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
@sergio_101@mastodon.social
https://sergio101.com
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101


[-- Attachment #1.2: Type: text/html, Size: 4692 bytes --]

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2020-01-09 16:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 16:56 sergio ruiz [this message]
2020-01-09 20:31 ` [org-babel] String interpolation using shell Mike Gauland

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=203196E9-AE09-4760-AF38-3D08D4622935@gmail.com \
    --to=sergio.rrd@gmail.com \
    --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).