emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sharing variables between source blocks without session


From: Loris Bennett
Subject: Re: Sharing variables between source blocks without session
Date: Fri, 19 Mar 2021 07:50:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Thursday, 18 Mar 2021 at 14:21, Loris Bennett wrote:
>> Thanks for point out using 'header-args;' as property.  However, if I do
>> the following, the variable is unset in the shell script:
>
> Works for me.
>
> Make sure you reload properties by hitting C-c C-c on the property line
> (or some other #+ meta line in the file).  Also, you will need to put
> the value of the user variable in "quotes", i.e. user="loris", for some
> reason.

OK, works for me, too now.  The quotes were the important thing, thanks.

For future me and the future in general, would it be a good idea to add
an example to

  https://orgmode.org/manual/Using-Header-Arguments.html

which illustrates the difference between strings and numbers,
e.g.

#+property: header-args:sh :var user="loris" fails=3 temp=17.1

#+begin_src sh
  echo user ${user}
  echo fails ${fails}
  echo temp ${temp}
#+end_src

#+RESULTS:
| user  | loris |
| fails |     3 |
| temp  |  17.1 |

?

Cheers,

Loris

-- 
This signature is currently under construction.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]