From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 4MUdMrSUK2ab2QAAe85BDQ:P1 (envelope-from ) for ; Fri, 26 Apr 2024 13:49:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 4MUdMrSUK2ab2QAAe85BDQ (envelope-from ) for ; Fri, 26 Apr 2024 13:49:08 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="c/xE2nzg"; 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=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714132148; 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=IV9Qz2UlawCvtxYFXoHC5JOQ/TVnjbQ5jdwqRbgMJTA=; b=r6RkVxI8lFbasvkl2eYCZ8+qSjdPQ/gzmXQdKM4oxPVot8knnUhafpOqnAvIogiNsG/ztT 4BdGULPj+A0U4mtfqFI8dza8Je57pUtUBDSLWkhCwTAMI3AqAQi0lIj/v6zjREKt4g92zp 1ftiCR0QfxIvUj9DTSpsiLo6JiReft7Ny/e5H9vjG7isRSekpw/90Y1I65xHOzlciFUkiR osmfmR2r8nGabe6izpXhdJdlaH9lvF5f43BwuZxIAiDKPkhaF9WOMXv5bT/g5CArQ6xuKC iONPiEZeZqvlP1lAdQxo//77iq8lh5FI/xmKXlMCjhy5bZNFsDRMFr/9fJFVvw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714132148; a=rsa-sha256; cv=none; b=Tgj4NBg5sq8an1LZTndhudYUFlSxRJ0MbOWisMMXhKAvdeJCWoU2mSMqP5zkf62jH81LrB w+Crz/SxDKhmgL995h7C+rqRTTtRKvlhKIbGl0OswbScMXNi6EEG1esGNZ35ie4iRHD4iA TSC5YJ2/PEuAa9fb69u0QUsZ5uydrp9+9kJ3iFDiLaf7T8AhAZ/s06CsuAeNaozLdSvcG7 84U3bzsYnwpEM+EtBOXsSWqvmTX67MEmSOOLoayCUrRmoysyrEEkzl68eXGJSZnqwqaDl2 vmmKd5LW9id9TEd7KdYSTq9cuKBZJAi/w9wbBxBoBfr6VVaQ7wp4rjF0sAwUCg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="c/xE2nzg"; 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=none) header.from=posteo.net 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 8ECEE388B7 for ; Fri, 26 Apr 2024 13:49:08 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0K3v-0005Qk-CZ; Fri, 26 Apr 2024 07:48:19 -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 1s0K3t-0005PU-5O for emacs-orgmode@gnu.org; Fri, 26 Apr 2024 07:48:17 -0400 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 1s0K3q-0004H8-ND for emacs-orgmode@gnu.org; Fri, 26 Apr 2024 07:48:16 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CEB6C240104 for ; Fri, 26 Apr 2024 13:48:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714132091; bh=KVncgQ5fv4iNz0GGeZigqn7bYDOpEszjzfEci+apiXM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=c/xE2nzgyyX8CfjMphcROAXS2fdSw9O66metTqRfLbIIGRzoUocUXQMt/6lQEE0Rg WDuRTZlVOfnyLL1d2EYGQ8yeWB7bP2RlsNrkGYKy3LfnZAQhgdmlSvCob08FgtTCti 3dZHKTIpeFR9F4QKGtveDHH1KSQvbPHuEVymqrAGU0zju4OMiIyN1A0GXa99CPzPx6 Ck3ieWawymKuMTepvF1Z2Ck3umCq6GblRODz8ZnsnMtaKCLBdo2z3fTcp4LTAmr/Nf sy61Knq/viOvyFIh/jiDt/qdBCV9G4nfTNdOq22rFAlSwl5uhcPoZ5T6atVB1dogGg douiP3zWxGl4g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VQrZf3xG6z9rxD; Fri, 26 Apr 2024 13:48:10 +0200 (CEST) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Re: [BUG] ob-shell: :shebang changes interpretation of :cmdline In-Reply-To: <87a5liexcu.fsf@localhost> References: <18f01342a2f.124ad27612732529.8693431365849276517@excalamus.com> <878r14qso9.fsf@localhost> <87a5liexcu.fsf@localhost> Date: Fri, 26 Apr 2024 11:49:11 +0000 Message-ID: <87le50uyx4.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_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: , 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 X-Migadu-Spam-Score: -9.30 X-Spam-Score: -9.30 X-Migadu-Queue-Id: 8ECEE388B7 X-Migadu-Scanner: mx13.migadu.com X-TUID: ln2LRyF4NnSN Ihor Radchenko writes: > Max Nikulin writes: > >>> + shell-file-name >> ... >>> + (list shell-command-switch >>> + (concat (file-local-name script-file) " " cmdline)))) >> >> Using `shell-command-switch' unconditionally may lead to executing >> /bin/sh instead of shell specified by `shell-file-name' for script files >> having no shebang, see >> >> https://superuser.com/questions/502984/writing-shell-scripts-that-will-run-on-any-shell-using-multiple-shebang-lines > > Good point. I am looking at this again, and notice that the problem with `shell-command-switch' is tangent to the original bug report we are discussing. Currently, ob-shell uses two ways to execute the source block: 1. When :shebang header argument is provided, '' 2. When :shebang is not provided ' ' The problem you linked to only manifests for calling script files _without_ shebang, while the original bug report is about the case when :shebang is given. I conclude that your concern, while being valid, is a _different_ bug. Thus, I do not see it as a blocker for my patch - my patch will fix the *original bug reported on top of this thread*. As for the problem with when does not contain shebang, we can trivially at that shebang like (with-temp-file script-file (if shebang (insert shebang "\n") (insert "#!" shell-file-name "\n")) (when padline (insert "\n")) (insert body)) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at