From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Berry, Charles" Subject: Re: Org source block header argument :var does not support space separated string Date: Mon, 22 Oct 2018 16:04:50 +0000 Message-ID: <8CECF1D0-89CA-4826-969D-98B11C5587B2@ucsd.edu> References: <87sh11htsy.fsf@gmail.com> <878t2sgypl.fsf@nicolasgoaziou.fr> <87r2giiz7j.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEciz-0004AQ-Je for emacs-orgmode@gnu.org; Mon, 22 Oct 2018 12:06:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEciq-0006Qg-E0 for emacs-orgmode@gnu.org; Mon, 22 Oct 2018 12:06:35 -0400 Received: from iport-bcv4-out.ucsd.edu ([132.239.0.122]:23796) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEcih-00062f-GX for emacs-orgmode@gnu.org; Mon, 22 Oct 2018 12:06:21 -0400 In-Reply-To: <87r2giiz7j.fsf@gmail.com> Content-Language: en-US Content-ID: <8D96F0E547CA82448BDD8218C6A79564@AD.UCSD.EDU> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: stardiviner Cc: org-mode , Nicolas Goaziou > On Oct 21, 2018, at 5:48 PM, stardiviner wrote: >=20 > Oops, I misunderstand the :var variable=3D"literal quoted string". > I want to reference the named source's result in variable. >=20 > Like: >=20 > **** encrypt text -- ~<<< [TEXT]~ >=20 > #+NAME: base64 encrypt text > #+begin_src sh > base64 <<< "stardiviner " > #+end_src >=20 > #+RESULTS: base64 encrypt text > : c3RhcmRpdmluZXIgPG51bWJjaGlsZEBnbWFpbC5jb20+Cg=3D=3D >=20 > **** decrypt text -- ~-d~ >=20 > #+begin_src sh :var encrypted=3D > # base64 -d <<< c3RhcmRpdmluZXIgPG51bWJjaGlsZEBnbWFpbC5jb20+Cg=3D=3D > # base64 -d <<< $encrypted > echo $encrypted > #+end_src This works=20 #+begin_src sh :var encrypted=3D(org-babel-ref-resolve "base64 encrypt text= ()") echo $encrypted #+end_src You might write a wrapper, so something like (quote-ref "base64 encrypt tex= t") will handle it. HTH, Chuck=