From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UMO+CrWVWGXWgwAAauVa8A:P1 (envelope-from ) for ; Sat, 18 Nov 2023 11:45:09 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UMO+CrWVWGXWgwAAauVa8A (envelope-from ) for ; Sat, 18 Nov 2023 11:45:09 +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 BE870523B5 for ; Sat, 18 Nov 2023 11:45:08 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=loZWMR+6; 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-Seal: i=1; s=key1; d=yhetil.org; t=1700304309; a=rsa-sha256; cv=none; b=lwTMGgsk1PIVZzM0anzv0P8oVyzn/DF9Tjiphs2NGR4WO20f9o3Srap+/JCU1epXZeXQt6 PsvUCia4DTkXd8NXaqvNnEETnHM553oe9MWFfm1X0y+7fPmhp25Om2NRKfypMrqPmZzBZq UfTDlxKZzMfLcr1LcASDhoINVHluEMji/IPiPW0n5kVhh/1fqcZ/cnPJ7463PWxUJXpbbK C7lFN2QjGRvTpfHca7LI9VsALQR1gtV4hHC0LjQHu7HGwlYT4Esz90Z4q3XjMctQHFYVWP 2Ud7d9fXN6YGuS+nqreuXnNC+u4cEP/kUd70+QpnUoVSG9QvyrSp1vlwzPKGzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1700304309; 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=cYqcTLSoxYx9r8Pz6+NLHhv2Xz1y08x7wHo2Lm2AJ5g=; b=CvI8St3x+eiU4zDIQ1KzkhhVnLcobFdaHoyZekj9ZrSo2PV7tTsSSQAvd5awGozuXts21M LoJmEllptRinZ1rNelDKN17kyPKuUcHdfZZncs5HNG1AzZCxjnERo9Y+7Kn99RanswCnw/ TH5f+5/QqsCq+ZlmTqtiaRIcKK4ygofw0oFW9eI0gOdiq38KhLdE7Aaoip1pY+aDcNYCUM PIv8zA4+97Lw9Gbc3JeQy9O3pCYjIvZ4DYVczSOFeUIsc21/NBGUrQVumrVM8NCibeRCit IPu6EYvFTCGDdHS87Jbh3oEwoqaD76OMi4GhLC/pCmnf1xbc0XgM45aye+Q1SQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=loZWMR+6; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4Iod-0002ov-7a; Sat, 18 Nov 2023 05:44:43 -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 1r4Ioc-0002om-3A for emacs-orgmode@gnu.org; Sat, 18 Nov 2023 05:44:42 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4Ioa-0001rm-By for emacs-orgmode@gnu.org; Sat, 18 Nov 2023 05:44:41 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 00EB9240101 for ; Sat, 18 Nov 2023 11:44:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1700304279; bh=8qCtE9t5EIL4KvCeHtJ9H6o/WljhKD788MMUgW3EDnU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=loZWMR+6V+Ds2FzMVdI4OrQ+2dcppvNwLksonGAjCO1laiQHButy/Rd/F7TeSa271 iScq9TUF8y12wodGLZB8Hq1pZF0LiyQK60yDSWtEzYYSGdq2y4Z/ZEy/VtIh8rfCET SX9ze9AuvSvORrnkcIfNCOMPm5hsTXTIG9a6iDOL2TORR/QkfRo+bmHVn2KmDvqhm9 Wc1wBcfTQuKfxBSiCeC5TD6NFNVE2/QeP01kP3s7bPR/YvjVX8COWGsqr3HB80+rHt uKqB/Osmyi6w7m5TWc11u3px/J6i17GxROd+P1MrJSUpK8kS71fv9mhbJrevrGLftX PEvNlQZDsjkpQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SXVlB3hMNz9rxB; Sat, 18 Nov 2023 11:44:38 +0100 (CET) From: Ihor Radchenko To: Matt Cc: Bruno Barbier , emacs-orgmode Subject: Re: Forget about "bash -c bash file.sh" (Re: bash source code block: problem after ssh commands) In-Reply-To: <18be1b0d843.da91946a3377707.4682124012173504521@excalamus.com> References: <25912.63830.726070.953843@gargle.gargle.HOWL> <653f8a93.050a0220.f2202.5816@mx.google.com> <87zfzr2ejj.fsf@localhost> <18ba5e231e3.f989cde147196.3154436412643995109@excalamus.com> <875y2e2b9y.fsf@localhost> <18bb07473e2.1007b1565819307.6938164403009000496@excalamus.com> <877cmr2ke4.fsf@localhost> <18bb5337346.dfcd5ebb1139895.801408740607633332@excalamus.com> <18bd3d38ff3.115b786cb2560022.7704006411630399228@excalamus.com> <87fs169h7f.fsf@localhost> <18bd984270d.1048050a22954105.2819987720224062869@excalamus.com> <25942.29051.701153.391260@gargle.gargle.HOWL> <18bd9ea2f7b.b77346232985684.5614027527324280790@excalamus.com> <871qcod9ad.fsf@localhost> <18bdf538f2f.126bad4763316098.8581777358227217138@excalamus.com> <18be17bf975.d175a3ef3371770.6719662597118588806@excalamus.com> <65587606.050a0220.53c59.4864@mx.google.com> <18be199b332.dc8678323375095.5527629479819727464@excalamus.com> <65587bd8.050a0220.b1cf7.4544@mx.google.com> <18be1b0d843.da91946a3377707.4682124012173504521@excalamus.com> Date: Sat, 18 Nov 2023 10:47:07 +0000 Message-ID: <87sf531gpg.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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_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-Scanner: mx11.migadu.com X-Spam-Score: -9.24 X-Migadu-Queue-Id: BE870523B5 X-Migadu-Spam-Score: -9.24 X-TUID: dh3ZBPxr3r3r Matt writes: > Evaluating the following > > #+name: /tmp/test.sh > #+begin_src bash :results output > ssh localhost "echo foo>foo_file" > echo "bar" | tee /tmp/bar.txt > #+end_src > > does exactly what > > cat /tmp/test.sh | bash -c bash > > does. Both create a file "foo_file" containing "foo" on the remote machine and neither execute the second line. > > So, I would say that what happens in Org is the "expected" behavior. Yup, it is expected. But only in a sense that "Emacs does what we asked for when calling `process-file'". From the user point of view, it is not expected at all. And, what is worse, may depend on (1) shell used; (2) ssh config (see StdinNull in man 5 ssh_config). I believe that we do need to change how we execute shell blocks _by default_ - to something more predictable, like creating and running a temporary script file. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at