From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 cFRSAiUULGT1cAEASxT56A (envelope-from ) for ; Tue, 04 Apr 2023 14:12:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id sORaASUULGT4YwAAG6o9tA (envelope-from ) for ; Tue, 04 Apr 2023 14:12:21 +0200 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 C271539F43 for ; Tue, 4 Apr 2023 14:12:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjfVx-0001tZ-Dq; Tue, 04 Apr 2023 08:11:53 -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 1pjfVr-0001t8-Rt for emacs-orgmode@gnu.org; Tue, 04 Apr 2023 08:11:50 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjfVn-0007wP-0y for emacs-orgmode@gnu.org; Tue, 04 Apr 2023 08:11:46 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id F0EB92405AE for ; Tue, 4 Apr 2023 14:11:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1680610300; bh=//hdrakEF5lu6NXAY9Y9ejLuvC85uUnsFE63mXBK7sc=; h=From:To:Cc:Subject:Date:From; b=FbP+ZWRTI8eqi42CWaimPX+C4iIyqbI6HfvlLsZdnOMHm3dS25DV2HfOUBV6X16lm rT7VY4dkEeHgQcj/lfucMmTJXz+5vg57G4f5239W/uUgBza9tHu8Cro+niUnMHrd/j qnrWtrt6qtryUtW+x5pyKW1L0RxQ7WXVIQzH5II4cMLeevIAv2EvCDIpLVDIRAbqEq Q6mnOng3dKI2qhG6sJGUq+AGWhM+8Cojwid+UiFFS++Sm1jc53gLSiZEBwTdo2QVmF /odPBs9gOoPoaKmlzq/oeCtntaM8RbMShD1kx9PIUEgsHnS7TVDX78ToyJc9sCxA+8 UpTAiAwffEJVg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PrRSq3jSrz9rxK; Tue, 4 Apr 2023 14:11:39 +0200 (CEST) From: Ihor Radchenko To: suarezmiguelc@icloud.com Cc: emacs-orgmode@gnu.org Subject: Re: Noweb Function's body without evaluation In-Reply-To: References: <871ql2mwdh.fsf@localhost> Date: Tue, 04 Apr 2023 12:14:01 +0000 Message-ID: <87v8ibalpy.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680610340; a=rsa-sha256; cv=none; b=a2dopZSoMcxmGl8HtWFk4Ysf6yE5cM2esD7TMOYbUhGfgva3ffYBdtc3Z0tvRUwrQv5sRl 2+dldLf7NDa3dU4P1wlGenxfQ92c28GBKVmsgEDRejB9si7v8rkcZ9HhLyw1h9X8QHxHs/ QQbO52eyRc/HIqL9EuldZe4WfzqKFVsVbwiRHcgoTTvYwmxqYI09V/znaOWIFOY3PtTqRx hmtkzwfFLy9+1/0i9ik/h4PPQE29mNDkra+rZFjxi56gWDxKIimRUZJ0RYynICnpb14+0h 8QCISJ8XlUZD3UyZQQsL4hDbCD9iai9Xcihgsmgovoi67NPdmBfnUyM6MGDe8g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=FbP+ZWRT; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680610340; 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=//hdrakEF5lu6NXAY9Y9ejLuvC85uUnsFE63mXBK7sc=; b=mAaZWM2HYHGPfXSnNHlWh0lU0RScaVXHq/mY+ml0eogSvjdZ52nR59P2MxEkt4656O/TOf 3y5gV5KA3r9Lff3NwbHLX/eMzSLY/S8sVbarZ5TCzOJsVno9y5QExeJHex4Z0ce3Y9FZPO 0zUW0ejR3PsS5Kh7j28ttpImEZX0zcp2Toelo9DA9tTVz9OX1bEykwqEPat8ffzwEcpiTe dB16knW0iAPnSVajFgrvQD91lFlKmX5Za5JJ5iHlBaniYcYauQ3jJ1iYFjArP4NIakyqzt wtLyJ++q+1iebdnBKg9CdN0Id05LiwW6QHfVrKZMx4mdXyVJ6NMAOeJzUIpkwQ== X-Migadu-Spam-Score: -4.71 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=FbP+ZWRT; dmarc=pass (policy=none) header.from=posteo.net; 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-Spam-Score: -4.71 X-Migadu-Queue-Id: C271539F43 X-TUID: LDQIwrQujxD4 suarezmiguelc@icloud.com writes: > #+name: getClientInstanceNameNew > #+begin_src shell :session something :var connection=3D"admin@10.0.3.149"= :var client=3D"example_client" :var apacheDir=3D"/etc/apache/vhosts" > <> > client=3D$client > apacheDir=3D$apacheDir > grep $client $apacheDir/* > #+end_src > > So, the initSSH call works successfully, so that concludes my first quest= ion, being that I can now affect the $connection variable. Thank you again! > > However, since the SSH call changes the environment, the $client and $apa= cheDir variables are not defined in the new environment. I did try setting = it again like above, but this doesn=E2=80=99t help as the variables do not = exist. Org babel knows not if the environment changes along the way. Of course, you can break the variable in bash by calling "bash" as one of the commands in src block. Or you can do more crazy staff and call "python" (or, say, "ghci") interpreter. There is no sane way to handle such weird scenarios programmatically. I suggest you to write some kind of wrapper like #+name: obl-identity #+begin_src emacs-lisp :var x=3D"" x #+end_src #+begin_src bash :noweb yes <> client=3D<> #+end_src This will not rely on language-specific way to define variables and instead generate the code you want to execute fully, on Elisp side. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at