From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 +F5tHT4BPGVRJgEA9RJhRA:P1 (envelope-from ) for ; Fri, 27 Oct 2023 20:28:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +F5tHT4BPGVRJgEA9RJhRA (envelope-from ) for ; Fri, 27 Oct 2023 20:28:14 +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 01A9B31089 for ; Fri, 27 Oct 2023 20:28:14 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=unistra.fr header.s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3 header.b=UFBPyMJP; 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-Seal: i=1; s=key1; d=yhetil.org; t=1698431294; a=rsa-sha256; cv=none; b=q/9C1RzhQHFY0VutS3hRJq03HsiLfN1xnXlIuwfQ/vbU6O6PeJQPL2JpGBRIxDvetwDsDb dJO8/c45uBBN8WEzEXKJXbYEgw7uquhYt/izGKAOfLQzowQzNJarMZxA7dTsC//T/zlxFk G3/q/kjNWh1lXdjZsYzH1cA2iF11ENplburLiyixiPkih8RfqmbqWXULV9i7gLZbESXMOZ xq4w7jnuzE5tb3nyouND1iIywzOXFEWgQhi0Ygf/EqsbrEhJWa9l312qwaGa3lq7DAryqC 4XJtN7pR93u4qmGJ5ON4GZu//PZBviI9SLLtk/m9wp71M8hkRdpTfNRALuKgig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=unistra.fr header.s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3 header.b=UFBPyMJP; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698431294; h=from:from:sender:sender:reply-to: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=JPpLvSrY5Sqbua2KXJ0v4Pf0DnZhmgGuvtdAUUzZh8M=; b=eigzcuMQFZZTR8wAQv+hnnyL1YnUlpuIJKXOB541dFJ5dxWMb8vMSwKRTEoG61TkBPMC4c sncc66BZ7LjTI5JUCqAfEGeVAKAYbJ/PMBCaARovey8gVRA0prN675jqJcoOS1vzAnbwcL c0U2Ys8ujYlp11dFbcpD3JMGBfQJAdZNGo/Uv+9vpgCyBw5O7z5iVPMoi0K65ytPNprqjX 7L8YCwfTDB1J2qBhcNiNHs8pbPXxRbvfbvC6yQU2RFJ379pHQllCgynS8KecIlrGuKZPbP IMrluYUExFXyifRnppNlxLYbBnkZuTTjZFMs6EOfmvST/VZEjvUgK+ND/9aqGg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwRYL-00067v-4U; Fri, 27 Oct 2023 14:27:25 -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 1qwRYG-00067f-TA for emacs-orgmode@gnu.org; Fri, 27 Oct 2023 14:27:21 -0400 Received: from smtpout01-ext2.partage.renater.fr ([194.254.240.33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwRYB-00073V-Bn for emacs-orgmode@gnu.org; Fri, 27 Oct 2023 14:27:19 -0400 Received: from zmtaauth03.partage.renater.fr (zmtaauth03.partage.renater.fr [194.254.240.26]) by smtpout10.partage.renater.fr (Postfix) with ESMTP id 8D3AA63865; Fri, 27 Oct 2023 20:26:55 +0200 (CEST) Received: from zmtaauth03.partage.renater.fr (localhost [127.0.0.1]) by zmtaauth03.partage.renater.fr (Postfix) with ESMTPS id 445A6802FF; Fri, 27 Oct 2023 20:26:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zmtaauth03.partage.renater.fr (Postfix) with ESMTP id 2CDE18034A; Fri, 27 Oct 2023 20:26:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zmtaauth03.partage.renater.fr 2CDE18034A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unistra.fr; s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3; t=1698431215; bh=JPpLvSrY5Sqbua2KXJ0v4Pf0DnZhmgGuvtdAUUzZh8M=; h=MIME-Version:Message-ID:Date:From:To; b=UFBPyMJPl1Xi6469tj8OApNcIHSZwIyDatJHRz1iff5L3fSRi8tqPbgH3VkTrzQfE Hs1QDBrUPHnIaEcm6rx7HTFA5g6hMNqMCmgjkz1P639/JRKFf1YrmJtKXi+RAjB4Lr eP1NtjTTK6/WVXU4wqD7Q4C1nWJ1ujPqHSROpHkA/xsbY7CUynpxVlXbbIgPNufrCJ N7C6uU2iFFI/aIB/6sZ1+23C9UGU/QPzur3h0TxnY7EKKIhIxslf2BZ68jG22JPWk6 cogUN3rQnKo2anE9Mk4AfB7qTQredVQZeWWjVCbWbwEO55VA8s5TSZmNFUO0TBVC1s clVgiaQImra4g== Received: from zmtaauth03.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth03.partage.renater.fr [127.0.0.1]) (amavis, port 10026) with ESMTP id x-Tog74iKweV; Fri, 27 Oct 2023 20:26:55 +0200 (CEST) Received: from 90.33.255.160 (unknown [194.254.241.249]) by zmtaauth03.partage.renater.fr (Postfix) with ESMTPA id AEB91802FF; Fri, 27 Oct 2023 20:26:54 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <25916.238.191509.652552@gargle.gargle.HOWL> Date: Fri, 27 Oct 2023 20:26:54 +0200 From: Alain.Cochard@unistra.fr To: Ihor Radchenko Cc: alain.cochard@unistra.fr, Leo Butler , "emacs-orgmode@gnu.org" Subject: Re: bash source code block: problem after ssh commands In-Reply-To: <87fs1xbis1.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> X-Mailer: VM 8.2.0b under 27.2 (x86_64-redhat-linux-gnu) X-Virus-Scanned: clamav-milter 0.103.8 at clamav03 X-Virus-Status: Clean X-Renater-Ptge-SpamState: clean X-Renater-Ptge-SpamScore: -100 X-Renater-Ptge-SpamCause: gggruggvucftvghtrhhoucdtuddrgedvkedrleeggdduvdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecutffgpfetvffgtfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepgggtgffkfffhvfevufgjfhforhesthhqredtredtudenucfhrhhomheptehlrghinhdrvehotghhrghrugesuhhnihhsthhrrgdrfhhrnecuggftrfgrthhtvghrnheptdevffdtuefhieefveegjefhffffffdtuddvgeefuddugffhtefgueffvdfhffegnecukfhppeduleegrddvheegrddvgedurddvgeelnecuuegrugftvghpuhhtkfhppeduleegrddvheegrddvgedurddvgeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelgedrvdehgedrvdeguddrvdegledphhgvlhhopeeltddrfeefrddvheehrdduiedtpdhmrghilhhfrhhomheptehlrghinhdrvehotghhrghrugesuhhnihhsthhrrgdrfhhrpdhnsggprhgtphhtthhopeegpdhrtghpthhtohepvghmrggtshdqohhrghhmohguvgesghhnuhdrohhrghdprhgtphhtthhopefnvghordeuuhhtlhgvrhesuhhmrghnihhtohgsrgdrtggrpdhrtghpthhtoheprghlrghinhdrtghotghhrghrugesuhhnihhsthhrrgdrfhhrpdhrtghpthhtohephigrnhhtrghrledvsehpohhsthgvohdrnhgvth Received-SPF: pass client-ip=194.254.240.33; envelope-from=Alain.Cochard@unistra.fr; helo=smtpout01-ext2.partage.renater.fr X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.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, NICE_REPLY_A=-3.339, RCVD_HELO_IP_MISMATCH=2.368, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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: , Reply-To: alain.cochard@unistra.fr 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: 01A9B31089 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -11.08 X-Spam-Score: -11.08 X-TUID: TM0C3FsHKOfn Ihor Radchenko writes on Thu 26 Oct 2023 13:44: > I can now reproduce the problem locally. >=20 > It boils down to >=20 > (setq exit-status > =09 (process-file shell-file-name input-file > =09=09=09(if error-file > =09=09=09 (list t error-file) > =09=09=09 t) > =09=09=09nil shell-command-switch command)) >=20 > that is an equivalent of >=20 > bash -c bash /path/to/file-containing-the-source-code.sh >=20 > ----- file-containing-the-source-code.sh ---- > ssh localhost 'echo foo>/tmp/foo=5Ffile' > echo $(uname -a) |tee /tmp/uname1.txt > --------------------------------------------- > If one tries to evaluate the above, the second line is not produced.= It > has nothing to do with Emacs itself. I am confused about what you specifically do to "evaluate the above". To start with, I have to use quotes to make your command be performed: bash -c "bash /path/to/file-containing-the-source-code.sh" Without the quotes, the 1st line is not executed either. NB: I get the same behavior with simply bash /path/to/file-containing-the-source-code.sh or, after making the script executable with 'chmod +x': /path/to/file-containing-the-source-code.sh But most importantly, the second line *is* produced, either if I use an SSH key for passwordless access or if I enter the password manually. > However, if I try >=20 > (process-file "bash" "/tmp/test.sh"), the /tmp/uname1.txt is not > produced. Here too, it is not clear to me how you "try". The way I know is to highlight (process-file "bash" "/path/to/file-containing-the-source-code.sh") and do M-x eval-region In this case, indeed, the 1st line is executed but not the 2nd one (again, whether or not I use an SSH key). --=20 EOST (=C9cole et Observatoire des Sciences de la Terre)=20 ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr 5 rue Ren=E9 Descartes [bureau 110] | Phone: +33 (0)3 68 85 50 44=20= F-67084 Strasbourg Cedex, France | [ slot available for rent ]