From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CIcFFmmYEmQyGQAASxT56A (envelope-from ) for ; Thu, 16 Mar 2023 05:17:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KGQDFmmYEmQAQgEA9RJhRA (envelope-from ) for ; Thu, 16 Mar 2023 05:17:45 +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 18473D4AB for ; Thu, 16 Mar 2023 05:17:45 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcf2k-0004rd-DS; Thu, 16 Mar 2023 00:16:46 -0400 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 1pcf2i-0004rP-D9 for emacs-orgmode@gnu.org; Thu, 16 Mar 2023 00:16:44 -0400 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcf2g-0002Aa-GG for emacs-orgmode@gnu.org; Thu, 16 Mar 2023 00:16:44 -0400 Received: by mail-qt1-x832.google.com with SMTP id s12so505015qtq.11 for ; Wed, 15 Mar 2023 21:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678940201; h=content-transfer-encoding:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=pvuAmZvJ2hDnae19frQWrGwsXMfv695MlP+C54cCxXk=; b=apT+7deqsYJh+3pkCh18OWV01MmNSlRlVdfkUaHEVcDOp6EPk0J5QTA/wG0zL/CdnT lXhFnbwJAqs+uuTvnIsGJyVP8cN4lcp/Fe0FQBBTcd4sb7ghnb5kq1p0hapG+mz3IgQE ENW8N/NFoca04IUOZbWbCaEekHlZUzGkumB36g5883qUfHOu3NAB8zVOZKwBC6dqFSZU Q8UZrnGJ7vCWKsFYVYyZhlDjA23Mam2clkXUEeQzDBqEVfzP1/FY2L9W0hr6jh91r3dh xJVtMj5gCJyd2fumcCp0Ggx7cJAOpx2QHUZF50Y4+7cd/NQs3Z3Jrb1bqi47lCQym0cU 8tkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678940201; h=content-transfer-encoding:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=pvuAmZvJ2hDnae19frQWrGwsXMfv695MlP+C54cCxXk=; b=fF51Z3D5RAcSBFXW1Hz6eOzs+WBJvmNSiA+cj3sIYvntckTEg1CQWHdAirVKFIL2W+ yZSAizu5e9hRTBFxWmtiF+h0eNQOyDMRs3Rz5yLPCYGxVbZ+tfnYFl23TEOh4E56yAM6 HGWX+XjAtl6mrvHmBFuVlKTEMEbz5P8KF3eDppE4oJIw2J2CnsJgpFrkMBXN0thBNcSS a6DVqXG8LEsgUWag8SCRAdLpz3ZNr/VYAHcsluRRWKOuvWTzHNkPnJFiTJKMHaHgoh50 08US6onyH0dhOx/ZZv0nj6irKFQ1u6m7hHwM/oSqec86EV2mRnd/f7HB9BnR7/IT2lQS xWHQ== X-Gm-Message-State: AO0yUKUmHuCduAErqJq/rp4ABuqIkmdFGyPafKL0zFp5luFVB6PWTaXM 0f0hbXc5Vc3Tt+A6dMAUoPe+7tLuZv0= X-Google-Smtp-Source: AK7set8hWVl0Sdh1/KRPDsMty6ozYM7BgW22r+31dXoRq40gV5hI6AEyyUJoXyueaIohFjceE+bEqg== X-Received: by 2002:ac8:5f86:0:b0:3d2:a927:21bc with SMTP id j6-20020ac85f86000000b003d2a92721bcmr3770053qta.18.1678940200979; Wed, 15 Mar 2023 21:16:40 -0700 (PDT) Received: from t480 (2603-7081-5f01-058e-100b-1238-d96e-2b65.res6.spectrum.com. [2603:7081:5f01:58e:100b:1238:d96e:2b65]) by smtp.gmail.com with ESMTPSA id o186-20020a375ac3000000b0074235386738sm5119910qkb.37.2023.03.15.21.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 21:16:40 -0700 (PDT) References: User-agent: mu4e 1.8.13; emacs 27.1 From: Ken Mankoff To: suarezmiguelc@icloud.com Cc: emacs-orgmode@gnu.org Subject: Re: Noweb Function's body without evaluation In-reply-to: Date: Thu, 16 Mar 2023 00:16:39 -0400 Message-ID: <87zg8dtjo8.fsf@t480.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::832; envelope-from=mankoff@gmail.com; helo=mail-qt1-x832.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=apT+7deq; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678940265; a=rsa-sha256; cv=none; b=E1iRyFHxLGCBTWEkiWQQX1c5gSCwYIuboM4BtcjGxcbjvic8do6AEZv5kV9ZCUM3zArjAg VIGrHb2U6YfM2c5JKZMsbwBc9k+3mUR4xV5xgv8ew/9cQMe0wd2ojPInv4+VJn6+mQlcMx zlgrgKxg7jIcGA+pEt7FwuIOYnG3ciWhHCgtUYzlgnHgy0lQ94cfXPXeajZonrBDfz1Hyx LyB2cstqy81amcUbiv1CrMzTNFthU7yQQsLzJ81kPZXpDl0DAjuMmU+Nhd4sczeoVcWPA+ mPEyRlTBLoBzQA3t+BKvhpK5DOKzqP7lxJfaqcNU80IxWf1QR6BoDBjC8smmNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678940265; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=pvuAmZvJ2hDnae19frQWrGwsXMfv695MlP+C54cCxXk=; b=kkQ8onQEa/bU16ZDj7CSZ/rRnCKtSPe/PWUJ62EZEWKF9jHw9ly+RTlKrMwz2RjKYHLkSA IF3wH5w90xTW4WkR+NpDH+zqRaF3XOF88XArFkGaWqGS3NZifEAhXuiRh7ldG69Iu7Zo7v 16IozzFUDlijBqHsPj4F5r8nKudN/VtERnaIwV5DDLsEOtfXMRxUvq7NfmWghRufVx+dya Sr5/QhpvuxKR8+zHyXCEbQNVIT4YTlwWTaRuiCoCNL86zYS8vmEloCPUlHnfXMkN+nQIJs TmpEtk3pRMvy+K7OQig8P4teOb9T3NNpIrj9aZFTkDnnQOmBd6Jb9WOXe7egWg== X-Migadu-Spam-Score: -6.47 X-Spam-Score: -6.47 X-Migadu-Queue-Id: 18473D4AB X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=apT+7deq; 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"; dmarc=pass (policy=none) header.from=gmail.com X-TUID: GFuxfkGPIicq Hi, I'm not sure that I understand your issue or needs from the provided exampl= es, but I wonder if the example I provide here would be helpful. It bypasse= s :var an lets you inject a PROPERTY value anywhere. It is also language ag= nostic. You can use it to execute commands (that are set as PROPERTY values= ) or set variables to values. https://lists.gnu.org/archive/html/emacs-orgmode/2023-03/msg00251.html -k. On 2023-03-15 at 18:54 -04, suarezmiguelc@icloud.com wrote... > Hello Org-mode community. I=E2=80=99m using Emacs Doom Framework, specifi= cally: > > Emacs 28.2 (build 1, aarch64-apple-darwin22.3.0, Carbon Version 169 > AppKit 2299.4) of 2023-02-23. > > I use heavily org-mode for Literate DevOps, so I have a lot of shell > commands that connect through SSH and do some things later, for > example: > > #+name: initSSH > #+begin_src shell :var connection=3D=E2=80=9Cadmin@somehost" > > ssh -t miguel@host "sudo -u someuser ssh -t $connection 'sudo su'" > #+end_src > > So then I can call: > > #+call: initSSH(connection=3D=E2=80=9Cadmin@anotherhost=E2=80=9D) > > With any other header parameters or session, the above works > correctly. I cannot use tramp due to network latency issues, so this > is the most performance way for me, since I also have to do some > multi-hops which are indeed supported in tramp, but it is too slow for > me, so I rather only commands. > > The thing is that, I then would like to call these not with a #+call > function, but add them into a bigger script, let=E2=80=99s say that I def= ine > another command: > > #+name: getStorage > #+begin_src shell > > df > #+end_src > > Which has to be run in a remote server, could be any remote server as > I have to connect to several. So I would like to be able to: > > #+begin_src shell > <> > <> > #+end_src > > > The first doesn=E2=80=99t work as org-mode runs the code and passes the > resulting string to bash, which isn=E2=80=99t a command. The latter works > normally. So the issue here are the parameters. > > So I made another simple example for this: > > #+name: greeting > #+begin_src sh :var name=3D"world" :results output :session testing > > echo "hello, $name\!" > #+end_src > > #+results: greeting > #+begin_src sh > > hello, world\! > #+end_src > > #+begin_src shell > <> > #+end_src > > > This results in sh: hello,: command not found, as it is executing the fun= ction. I see in the documentation that I can: > - Call a function=E2=80=99s body with <> > - Execute a function and return its results with <> > - Execute a function and return its results even with different params wi= th <> > > So right now, the one that=E2=80=99s missing is, call a function=E2=80=99= s body with different parameters. So the > function <> is not evaluated. > > After searching a lot, I came across: > > #+begin_src shell :session testing > <> > #+end_src > > Which results in: > > sh-3.2$ PS1=3D"org_babel_sh_prompt> " > org_babel_sh_prompt> name=3D'Testingggg' > org_babel_sh_prompt> echo "hello, $name\!" > hello, Testingggg\! > org_babel_sh_prompt> echo 'org_babel_sh_eoe' > org_babel_sh_eoe > org_babel_sh_prompt> hello, Testingggg\! > sh: hello,: command not found > org_babel_sh_prompt> echo 'org_babel_sh_eoe' > org_babel_sh_eoe > org_babel_sh_prompt>=20 > > Which is somewhat what I need since at least the variable is changed, > but the result of this execution is also passed to shell so, same > error. > > I can=E2=80=99t find much documentation about this, what is the correct s= yntax > here?, > > Thank you!