[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Org source block header argument :var does not support space sep
From: |
stardiviner |
Subject: |
Re: [O] Org source block header argument :var does not support space separated string |
Date: |
Mon, 22 Oct 2018 08:48:00 +0800 |
User-agent: |
mu4e 1.1.0; emacs 26.1 |
Nicolas Goaziou <address@hidden> writes:
> Anyway, I tried the following block:
>
> #+begin_src emacs-lisp :var encrypted="base64 encrypt text"
> encrypted
> #+end_src
>
> and the output is
>
> #+results:
> : base64 encrypt text
>
> which means there doesn't seem to be a problem with strings within
> quotes.
>
> Regards,
Oops, I misunderstand the :var variable="literal quoted string".
I want to reference the named source's result in variable.
Like:
**** encrypt text -- ~<<< [TEXT]~
#+NAME: base64 encrypt text
#+begin_src sh
base64 <<< "stardiviner <address@hidden>"
#+end_src
#+RESULTS: base64 encrypt text
: c3RhcmRpdmluZXIgPG51bWJjaGlsZEBnbWFpbC5jb20+Cg==
**** decrypt text -- ~-d~
#+begin_src sh :var encrypted=<base64 encrypt text>
# base64 -d <<< c3RhcmRpdmluZXIgPG51bWJjaGlsZEBnbWFpbC5jb20+Cg==
# base64 -d <<< $encrypted
echo $encrypted
#+end_src
#+RESULTS[<2018-10-20 16:46:10> 6e5d3875d0928eb95ec1356661f965bdf4882244]:
I can use #+NAME: base64-encrypt-text for first source block, and :var
encrypted=base64-encrypt-text for second source block. So it can work. But is
it possible to allow space in source block name and make it still can be
referenced? Like quote it with <> around the name as my upper example?
--
[ stardiviner ] don't need to convince with trends.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3