From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4FvhN8mWhWN7BwEAbAwnHQ (envelope-from ) for ; Tue, 29 Nov 2022 06:21:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id IIffN8mWhWOzHgAA9RJhRA (envelope-from ) for ; Tue, 29 Nov 2022 06:21:13 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7F85011365 for ; Tue, 29 Nov 2022 06:21:13 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozt2S-0006z3-4m; Tue, 29 Nov 2022 00:20:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozt2Q-0006yu-Bc for emacs-orgmode@gnu.org; Tue, 29 Nov 2022 00:20:10 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozt2O-0004Q0-Mp for emacs-orgmode@gnu.org; Tue, 29 Nov 2022 00:20:10 -0500 Received: by mail-pj1-x102a.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so16223174pjs.4 for ; Mon, 28 Nov 2022 21:20:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=M28wtOa/jc1SY6MN6N3ORrV13bUvfe8pPUJa9xe7Tz4=; b=qpN8a9LdBJL4JQknPOBSX6KVp6YIXDCYJiG/uxvVe2GBxkgWz9bYeAbA82Draaf+zn I1s7W730v2opeoaW+Vf+Xa/9F1MkIPmFUhBhRZOtUkoivIjRz9kfeG3qZEKD14DL1b3J vKG4FjMYvxYkGrDdU92fwu3thmc6DcSpDxy3gZ58qCCat8B1CXqq+ocpsSCnfakH+dcB eJxIK/PvqNUiEGstcp9OuKDoyWl8hVZi1QJIXzZez6mksb4+hPl3mhumC6BkZnfOk+BS UfjC0tkKcyjbUwHVN9WG4U6HA1Ya3ics2FCLmvaGi7dOsSf7MCet2gNxIsUSGpHRTGAg BD9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M28wtOa/jc1SY6MN6N3ORrV13bUvfe8pPUJa9xe7Tz4=; b=uQMlLlT+paDIdCQjQHpaWaqq+TO5af/KY2ElzHwJTgBm2IRiohe+Nbni7QNVbyBExC 7mofMb95jzpxndRF2yX/z/WWZEDc9H1F0sZvRUv9i3lH96u50ctJ1UvYdJltZvl7xCdZ lWJl0woQ7eUiYa+UZW516HAsluR8af1pmGx1ekP/3F+p5zVX3w5vL1Ao8CTqvYLcqe4L IgIbb9GhMr2GuBmxPy4O1ojrlB920o+i1wcn+XZ7TyE49e+ihddsHy/CQYHIdHfkOvhw 5/SOScAWmvUw6YrTgjSHC337Fdd6DM9iUY81cHaIoXjPAD8fnK+5KCD3ncRSXdiP7c9y Pcdw== X-Gm-Message-State: ANoB5plsLO0hlyme2RFGXhp0q+Bja+v9mUv+5XOBMLydaLHYNgSKXWcb H+pbIGD8CZnGc0OHL0MTEd9rTqpJr/Z4ZTe1qd8= X-Google-Smtp-Source: AA0mqf7tQsuuACKTRCZiFOtXLOcIpKyHTePyrAfGVFaYbhxHx7kg6u0KS54Xgzxb5j8+ApMfpEJ8Gxop6DZrVU2CVKk= X-Received: by 2002:a17:90a:990d:b0:212:d909:a41e with SMTP id b13-20020a17090a990d00b00212d909a41emr16149462pjp.48.1669699206030; Mon, 28 Nov 2022 21:20:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bill Burdick Date: Tue, 29 Nov 2022 06:19:54 +0100 Message-ID: Subject: Re: Adding #+name to result block in babel To: Henrik Frisk Cc: org-mode-email Content-Type: multipart/alternative; boundary="0000000000000ea94305ee952479" Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=bill.burdick@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669699273; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=M28wtOa/jc1SY6MN6N3ORrV13bUvfe8pPUJa9xe7Tz4=; b=HDRkDKHorZbEH20Ca5DdOTHLxgJU3PwNTeiX0J9YOBAnNblzkkoUCzpHk9B5Iu3ucS/GYP C/MkunRzUzrIIu7xvO5PTS07qanQteM/J6MZ3HtIa6OwqCV0O69R43BZ9eo0J0LX9BTIzj uvEXg+1xrVgb0ZnSregzLQO1mBQ766iPb+iLJpJkJFwWTKLXcWmCGueyWR5kENdM5zrOSC +vxWIEFxTz56J3PbAHYyOe0rXCusGLR6RKI63oOMM5eDGONjM/KzjmI91SdTWw5IurUujv uCtbK1vQ+kgsz9BWwill1WFZCe4y1ts/ZhrAMDfKiPWmL9vPlb20HmJBxX1vqQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669699273; a=rsa-sha256; cv=none; b=KicqHIW87oA03Cj/O6fAFVZ+BJLtpE/irN4KloNVebP37xZ21ETgYy/5q8DJtg72+XHMo5 JZPV0WsdyZDCJAsi+F0u020IjaGBe6awKq6db/zBCdMmZtRbfx+aArf41MNCgTdh0X7HXy YHoqTcutUcFxI8qAI6EsVI7kQP1PM02+GBq7ThyOhgVlQulfOPajqr+zkiIjoc7/T8eqMe C7znPTXIWb40uBjKuosqgQ9fh9Vj/72KX4KnxMDQa9pvnNf/Hpo+42iddQ1Bn7+rx5V0/X TIW2S93pSEwW/AQCuQMiYXlxVwJEbtYVLgUvXh9TT2J+R+FY+aTxYTSTy5syqQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=qpN8a9Ld; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.96 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=qpN8a9Ld; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7F85011365 X-Spam-Score: -3.96 X-Migadu-Scanner: scn1.migadu.com X-TUID: 98/LzUxnLL9s --0000000000000ea94305ee952479 Content-Type: text/plain; charset="UTF-8" Hi Henrik, On Tue, Nov 29, 2022 at 2:11 AM Henrik Frisk 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 --0000000000000ea94305ee952479 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Henrik,

On Tue, Nov 29, 2022= at 2:11 AM Henrik Frisk <frisk.h@g= mail.com> wrote:
Hi,

Maybe I'm mi= ssing something obvious but is it possible to have a name be added to the r= esult block such as running:

#+begin_src shell=
=C2=A0 echo "Hello"
#+end_src

results in

#+RESULTS:
#+name: my_result=
: Hello

Thank you!
<= /blockquote>

Name your block, like this:
=C2=A0 =C2=A0 #+n= ame: my_result
=C2=A0 =C2=A0=C2=A0#+begin_src sh
=C2=A0 =C2=A0=C2=A0e= cho hello
=C2=A0 =C2=A0=C2=A0#+end_src

When you evaluate it, you&= #39;ll get this:

=C2=A0 =C2=A0=C2=A0#+name: my_result
=C2=A0 =C2= =A0=C2=A0#+begin_src sh
=C2=A0 =C2=A0=C2=A0echo hello
=C2=A0 =C2=A0= =C2=A0#+end_src
=C2=A0 =C2=A0=C2=A0
=C2=A0 =C2=A0=C2=A0#+RESULTS: my_= result
=C2=A0 =C2=A0=C2=A0: hello

Then you can use the result lik= e this:

=C2=A0 =C2=A0=C2=A0#+begin_src sh :var value=3Dmy_result
= =C2=A0 =C2=A0=C2=A0echo $value
=C2=A0 =C2=A0=C2=A0#+end_src
=C2=A0 = =C2=A0=C2=A0
=C2=A0 =C2=A0=C2=A0#+RESULTS:
=C2=A0 =C2=A0=C2=A0: hello=


-- Bill
--0000000000000ea94305ee952479--