From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id YGviC7fkS2U7pAAAauVa8A:P1 (envelope-from ) for ; Wed, 08 Nov 2023 20:42:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YGviC7fkS2U7pAAAauVa8A (envelope-from ) for ; Wed, 08 Nov 2023 20:42:47 +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 E5C8F151C1 for ; Wed, 8 Nov 2023 20:42:46 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=F8UMD+fk; dmarc=none; 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=pass ("zohomail.com:s=zohoarc:i=1") ARC-Seal: i=2; s=key1; d=yhetil.org; t=1699472567; a=rsa-sha256; cv=pass; b=OKe7EIy2sOQ/ptkkh1rIMjmYSw/UjYdZjb7l0Ls7x3BXndQzSatjBH4kO7qPVCPJ+J2+LZ 09DvJIWv1MdOgOQi0wCLMQn8QLCnT34PfKL0tmFmP2lWZTflux4D8jmsG/BlpKjtHq0Nvj +T8ussjwBwFfJ82sKiERj8fm6egY1ivdd/k9LaBKNRx4xMPXlFpJPiLC5VqaQwUPV9KCn2 SIuA59WBEVKNaGgpgtQYcVWKl0FMreRDWUXBFIK0jZjzr2/jTZR2qQGWUXZDUE6JAd2kYg NP0EOzzQxWYg+GXbWqTI4/i5nhSftAKe42PGCjl8c8PvMGE8VqsLf5zXsyO1Lw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=F8UMD+fk; dmarc=none; 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=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699472567; 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=1WuPLLsMJIR4mTfE2d0KIkNct9imcTkF9hdFdkgFg8c=; b=Q5IgYvXzFKRBoUEfZeiDhpL6+NKrr6T1t83Ajc/iAec6HwanXZUF8Cdahqv31wrdl81Bu+ QXWeMlyAhbCs4AP1PAxA2EKGdt6y15WY7OhQXODcOMQNbHkGUOd6zkU7KBEjuucg7fTYpk YkEzvdlFcEwjZP01nbsEYXKIjwKOOSeycItGj/Jop81r4WUJKaRMXrnbXJIk9ngBOQqFqx NJAZR4SzTQTznC3dxx3Ke982NoIaiBot0Wrx+1OL8VG3JlTnWHx9vh4vKpSafgMPQutF7H q3ZvYzHGv+opUi6fhuHmGBRnhd7k9NZ68fOTOuaa6+uanj9J/40Zwl00qt4qbQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0oR3-0003GO-Qn; Wed, 08 Nov 2023 14:41:57 -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 1r0oR1-0003Fv-K4 for emacs-orgmode@gnu.org; Wed, 08 Nov 2023 14:41:55 -0500 Received: from sender4-op-o14.zoho.com ([136.143.188.14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0oQv-0006aP-4L for emacs-orgmode@gnu.org; Wed, 08 Nov 2023 14:41:55 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1699472505; cv=none; d=zohomail.com; s=zohoarc; b=SEQxB/3J7rlk8H1ybHDI1aMsqdaBVhm+AMEl7WR5x7DXm7TZwdgfgSOxIC0hI4I2E/0Sc/++rNh1Zwz93PdNbu/TDgav7IEEsFRZ3Tg8YvUe1MZ2r/1JfD2AponRQvOiOMbmjWYvJURmym53NF15ULr2hCGdUL+Ej2yok5XCf5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699472505; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=1WuPLLsMJIR4mTfE2d0KIkNct9imcTkF9hdFdkgFg8c=; b=elrzUvCWxdulMetZQObawDeACF9WlQvB5CwwLarCkhuqM4YU5Ray84lfHKhFLBH/qck33iO3FQB9B7MXIPOlXmgikSN3u1CLP+llF3E1h1TK25eC2DnYKmdOo8e11Y6Dj2+zmTg2CIZTN1uly1re8lLXpA93ldtscJo8Ddvzgls= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=excalamus.com; spf=pass smtp.mailfrom=matt@excalamus.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1699472505; s=zmail; d=excalamus.com; i=matt@excalamus.com; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=1WuPLLsMJIR4mTfE2d0KIkNct9imcTkF9hdFdkgFg8c=; b=F8UMD+fkul9fj7ih6BNebyhRyx5D2hMG5lCiTC7P8FIKLgEZm5Qq4G7YrGZBK2nI Q++Bh3D5F16w4Ao006cnbtVoncwiwx6Gy07a0vaBKhTeGzvrcNUiFHDg1o0/v5A80bw cf4j2iwuHzVTpshOQMNISz1ZWaUlQUJ7EtXJB5v0= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1699472503802865.3950008464321; Wed, 8 Nov 2023 11:41:43 -0800 (PST) Date: Wed, 08 Nov 2023 20:41:43 +0100 From: Matt To: "Ihor Radchenko" Cc: "emacs-orgmode@gnu.org" Message-ID: <18bb07473e2.1007b1565819307.6938164403009000496@excalamus.com> In-Reply-To: <875y2e2b9y.fsf@localhost> References: <25912.63830.726070.953843@gargle.gargle.HOWL> <87bkcmlor9.fsf@t14.reltub.ca> <87o7gldb78.fsf@localhost> <25914.26693.101108.954656@gargle.gargle.HOWL> <87fs1xbis1.fsf@localhost> <25916.238.191509.652552@gargle.gargle.HOWL> <653f8a93.050a0220.f2202.5816@mx.google.com> <87zfzr2ejj.fsf@localhost> <18ba5e231e3.f989cde147196.3154436412643995109@excalamus.com> <875y2e2b9y.fsf@localhost> Subject: Re: bash source code block: problem after ssh commands MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Received-SPF: pass client-ip=136.143.188.14; envelope-from=matt@excalamus.com; helo=sender4-op-o14.zoho.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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 X-Migadu-Queue-Id: E5C8F151C1 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -10.14 X-Spam-Score: -10.14 X-TUID: NWrtyWrOJRcP ---- On Tue, 07 Nov 2023 09:53:46 +0100 Ihor Radchenko wrote ---=20 > Matt matt@excalamus.com> writes: >=20 > > ---- On Mon, 06 Nov 2023 14:32:16 +0100 Ihor Radchenko wrote ---=20 > > > I am wondering about the possible downsides of using script approac= h > > > instead of stdin redirection. > > =20 > > I'm curious to hear more about what you're thinking. >=20 > I am thinking to change the > (t (org-babel-eval shell-file-name (org-trim body))) > clause in `org-babel-sh-evaluate' to something that uses a script file. >=20 > It will clearly solve the discussed problem, possibly at the cost of > small overhead to write the script file to disk. =20 Thanks for clarifying. I've been away from the codebase for a bit and, now= that the FSF paperwork is signed (still need to get Craig a copy), I'm rev= iewing =3Dob-shell=3D with an eye for what could be cleaned or improved. = I feel like =3Dorg-babel-sh-evaluate=3D could use some attention. I'm open to your suggestion. The good is that using a script is how :sheba= ng and :cmdline are processed currently (like you pointed out) so there's p= recedence and experience with it. Also, it would make all non-session exec= ution use the same model (script versus comint). I like how that would cre= ate a clean separation. For bad, nothing jumps out to me as obviously a problem. Let me "think out= loud" for a moment. We'd need to write to disk. Like you say, this incur= s overhead opening, writing, and closing the file. It's not like we'd forg= et to close it, though. Nor is running out of space or inodes our problem.= Writing requires permission. That's not an issue with /tmp. Then, it ne= eds to execute. Aside from permission, any code we insert needs to be corr= ect. For example, a shebang would need to point to the correct application= and any arguments would need to correspond to the implementation being cal= led. I doubt we'd need anything beyond /bin/. FWIW, it looks like= there's been at least one instance where :shebang's formatting was questio= ned (https://yhetil.org/orgmode/CA+A2iZZ1vMmKiUf4Fem1AU7CA1m9GQap+BkvrOsz+0= BxRt6rRA@mail.gmail.com/). We'd also need to control for what environment = the script runs in. That was another issue I saw raised in the list (https= ://yhetil.org/orgmode/87609ug5ae.fsf@luisa.c0t0d0s0.de/). Of course, we'd = need to read the stdout and stderr. This is handled by =3Dprocess-file=3D.= Any step I missed or some kind of failure I didn't consider?