From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id OJRXJ7nqSGXBLwEAauVa8A:P1 (envelope-from ) for ; Mon, 06 Nov 2023 14:31:37 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id OJRXJ7nqSGXBLwEAauVa8A (envelope-from ) for ; Mon, 06 Nov 2023 14:31:37 +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 13A8164ACB for ; Mon, 6 Nov 2023 14:31:37 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dKxVxQVx; 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=1699277497; 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=DrEdnutilVh5rPlrig29lONAKvbsruZ7zqHBKptHOOQ=; b=ddXUOsf0mn56WvwH6a8xuXrhKZ3a7c3en+eux8kYQ3MzUj3tLTjxmeMGfOlfWhVLK5kL6x sD4QfyGBgPdKkB1OTceqcIGnsVaEUrCrpAyhFClcMTbTnQaXHboioVR/uvm6UZeiXv5I6O JufDG95DVSh5UJDmUDY9D86/LZPcHq7gW24RHnDPRx2iLh6tLbd4Y5bC5fySEqk+Y4WOyq f7QtWnIcOB4HMIyRgQBPdJvaIGrHatw5b/we9J4neBURvSb0r0Q+VcIkoLYgJRoq6WO7cG qGUTa13fq89gdUP8KlxgtHlchR5GKJOp6OPEefNN70mzD92iitg7VHVrro2MfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dKxVxQVx; 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=1699277497; a=rsa-sha256; cv=none; b=k38g7eg9JM0XMiUrataockLLJ5W+UkEUoV6wInQeaHJOHlMabtSz2f6MOka7AXz9LTDjuC yYsXiNHpv7X5J/K4/FaJnw662UAcO4E8K1X8Jn4XEFfGTRfIC42WwfOvuiO+pNhQ3F2voW GrMfrOZIxXavkkRwTd+3YM1Dq1N2dcB3px9Pvb5yrsxXODr+Ah7hln5GB6vgHLHWOmT2ih SOWpzt6ruHAs0XgTj0ZrA83bXdzC6oBFh+n1b8GiDkQd/nK0E+bzjvNQQVzL2RnOtFXs5G 4M2DcXUzYbHaTrOA/laMCBWPtZ4aYweDjzv8DD03MfaFSeaQpXWy2Tr8BB90Ww== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzzgh-0004zJ-MK; Mon, 06 Nov 2023 08:30: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 1qzzgY-0004xp-M9 for emacs-orgmode@gnu.org; Mon, 06 Nov 2023 08:30:40 -0500 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 1qzzgR-0003Rv-MN for emacs-orgmode@gnu.org; Mon, 06 Nov 2023 08:30:34 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 7452A240028 for ; Mon, 6 Nov 2023 14:30:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1699277422; bh=uHOaFLsPlMw8esrfs/xQZSsx47Zj/bBKC7FjRispYQ4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=dKxVxQVxtxImzLNnxJfl2/WkIeK0WIsuMv1zShy5bBg/IFrTpTftXfH89yu3iMIeZ xWEeGBqMVsbkQgCxt16EZAQC0Aaz8V3V244J+nv1atc2ylPIKWIwTpB7Wa9Owmu3Hw L1cCuORX6WQ5CcRueqnkOBbU9dGj/g6UkjmDZqrWHOzSWKfDTa5icfydQLz9FxvigS mmAGVi4B2gFamV0/PP1BxqiSMqgNwGOpBW3MVl3FtpcqwfoXaQBmpyhDbg5T1wpxry XUcmvadDaKs50UO8GDfVXphrT5fnUoZiw2p7laOG2yw1SP8eklKCQeG6IPGAIDnI42 R4in3dIse3XHQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SPBzx2ssrz6txW; Mon, 6 Nov 2023 14:30:21 +0100 (CET) From: Ihor Radchenko To: Bruno Barbier Cc: Alain.Cochard@unistra.fr, Leo Butler , "emacs-orgmode@gnu.org" Subject: Re: bash source code block: problem after ssh commands In-Reply-To: <653f8a93.050a0220.f2202.5816@mx.google.com> 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> Date: Mon, 06 Nov 2023 13:32:16 +0000 Message-ID: <87zfzr2ejj.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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_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-Spam-Score: -7.45 X-Spam-Score: -7.45 X-Migadu-Queue-Id: 13A8164ACB X-Migadu-Scanner: mx10.migadu.com X-TUID: ZxF0DgzzH1K5 Bruno Barbier writes: > IIUC, the elisp expression: > > (process-file "bash" "/tmp/test.sh") > > is more equivalent to: > > cat /tmp/test.sh | bash > > i.e. the shell is getting the commands from stdin. Thus, any command > that uses stdin might change what gets executed or not. Looking at `org-babel-sh-evaluate', it should be enough to specify :shebang, :cmdline, or :stdin header argument to force using script rather than channel source block as input to bash: #+begin_src shell :results output :cmdline bash exec 0>&- echo OK #+end_src #+RESULTS: : OK #+begin_src shell :results output :cmdline bash echo 1 read -p "Next command? " NEXT_COMMAND echo 2 echo 3 #+end_src #+RESULTS: : 1 : 2 : 3 I am wondering about the possible downsides of using script approach instead of stdin redirection. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at