From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qBmqOQNNEmSgbgAASxT56A (envelope-from ) for ; Wed, 15 Mar 2023 23:56:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mJmjOQNNEmTlDAAAauVa8A (envelope-from ) for ; Wed, 15 Mar 2023 23:56:03 +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 7DE8C2B405 for ; Wed, 15 Mar 2023 23:56:03 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pca1V-0000Pm-5Z; Wed, 15 Mar 2023 18:55:09 -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 1pca1T-0000Pc-P7 for emacs-orgmode@gnu.org; Wed, 15 Mar 2023 18:55:07 -0400 Received: from qs51p00im-qukt01072701.me.com ([17.57.155.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pca1S-0006VI-4W for emacs-orgmode@gnu.org; Wed, 15 Mar 2023 18:55:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1678920903; bh=SqZHpA6oTmoEZqbhzojzZt9zW4FDw0XuajzOu5mTEhA=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=p3Dw7l/jGiOUtJLQ0gFOHze1HCjoyvb6Gy9HAzpP+sty8rvM3hgiiDCBNjJduP0d8 EraEaxla5i49kbWSyVdHc6P2m6BEfNbyLBpCt1x7qOj94hQa1uFe4U3kmn4WnUzWBD EJSjTvI+J3QpHKs8LB2d7Lcdne3Nu3ptM9mHDajCnUuYRkFgOWlW3Vd/sV6o0B3h7o Nqrh4gIrHZ6i3flaM+uL4gBpMrcF8dfE9sTD3Sxtw5skaMlJRiQso8q1eiwgjQ5Mjo uyNPxDmlVZ3Q7/lRh+V3dof8FAjJVMoEdM5cnWAzpaJRXPVTx/CoFzYmM4StUVV/Xo /ZNNp4ObzmZnA== Received: from smtpclient.apple (qs51p00im-dlb-asmtp-mailmevip.me.com [17.57.155.28]) by qs51p00im-qukt01072701.me.com (Postfix) with ESMTPSA id 938B515C0C05 for ; Wed, 15 Mar 2023 22:55:02 +0000 (UTC) From: suarezmiguelc@icloud.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Noweb Function's body without evaluation Message-Id: Date: Wed, 15 Mar 2023 23:54:49 +0100 To: emacs-orgmode@gnu.org X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Proofpoint-GUID: 5Q2zhE8Y-FjJH7hVIrjmgeNIP1CXDRKf X-Proofpoint-ORIG-GUID: 5Q2zhE8Y-FjJH7hVIrjmgeNIP1CXDRKf X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.572,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2022-01-11=5F01:2022-01-11=5F01,2020-02-14=5F11,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 spamscore=0 mlxscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=819 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2303150187 Received-SPF: pass client-ip=17.57.155.16; envelope-from=suarezmiguelc@icloud.com; helo=qs51p00im-qukt01072701.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, 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-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=icloud.com header.s=1a1hai header.b="p3Dw7l/j"; 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=quarantine) header.from=icloud.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678920963; a=rsa-sha256; cv=none; b=Q88nI3dDu8RdbBLTH4VMTFMXUXqtLVw/VFXO7KDh6ENmWOr+P9+lP4ohDn4GM8BmzuTvUv buyj6A5vM5XrVTUDFBMbC7GndVr1/rcPe28D3pB0EOZuVGUcE5CyiAYt7+obD3vISYaNDe hmWbB1imA7h6rMFn/C6UTHJpkmGUXHS+mXtkPpbttXAb8xc3aTLY96xNKlJi22EzWWaivc 9N9HMn1Mfe7nHF24e2U7bL7aataqoYf0NIHPYzs+MNyIQ7rBQvgEg/aaDf8ipRMu2XE/Yu Y8en7ZyAl8rOp1P7ey8Wljw673mWJP7IAjkhlNLyHpjRO2hnglM4c045nAiZRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678920963; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=SqZHpA6oTmoEZqbhzojzZt9zW4FDw0XuajzOu5mTEhA=; b=Yl3X2WT5nsB3wOrtenvBekOhjGfoZaFpstUwgYJ7cYP4OpA3TLlYDY5N7db/CiHFMr+yRO mhfcbdxBo2ZCifdQQ1uVx8nG+o1FG7xI91zfQXt4FG6OO0FezRxHUbfkm3a29bcGysDo5d IxAy32y2rZQL8viBx49ALW6TGdYp4KI1NEciKYJYRufHKOGF27vpyGABTgwdE3riK8qIWf Zc6MDqdEb+8yAFBQ/5/B1Kfaosl9cjQ2by+FqDfW2pFrpyGWTDF8AwosrrYZFSQVSywLsX uoIYLqCEUroB9pCboLWzFuWTo1HMiEwgqvCmo9Y4wLX4iKBVPcvQrFUPKQHDkA== X-Migadu-Spam-Score: -6.17 X-Spam-Score: -6.17 X-Migadu-Queue-Id: 7DE8C2B405 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=icloud.com header.s=1a1hai header.b="p3Dw7l/j"; 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=quarantine) header.from=icloud.com X-TUID: IaN6A0F8rgXU Hello Org-mode community. I=E2=80=99m using Emacs Doom Framework, = specifically: 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 = define 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 = function. 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 = with <> So right now, the one that=E2=80=99s missing is, call a function=E2=80=99s= 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 = syntax here?, Thank you!=