Hi Henrik,

On Tue, Nov 29, 2022 at 2:11 AM Henrik Frisk <fris...@gmail.com> wrote:

> Hi,
>
> Maybe I'm missing something obvious but is it possible to have a name be
> added to the result block such as running:
>
> #+begin_src shell
>   echo "Hello"
> #+end_src
>
> results in
>
> #+RESULTS:
> #+name: my_result
> : Hello
>
> Thank you!
>

Name your block, like this:
    #+name: my_result
    #+begin_src sh
    echo hello
    #+end_src

When you evaluate it, you'll get this:

    #+name: my_result
    #+begin_src sh
    echo hello
    #+end_src

    #+RESULTS: my_result
    : hello

Then you can use the result like this:

    #+begin_src sh :var value=my_result
    echo $value
    #+end_src

    #+RESULTS:
    : hello


-- Bill

Reply via email to