From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id qBBFFueaPGUlkAAAauVa8A:P1 (envelope-from ) for ; Sat, 28 Oct 2023 07:23:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qBBFFueaPGUlkAAAauVa8A (envelope-from ) for ; Sat, 28 Oct 2023 07:23:51 +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 30F0F55CA2 for ; Sat, 28 Oct 2023 07:23:51 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=M4j8CLbP; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698470631; 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=9pVkhs6NrtgMEV2lvNUNQagSbtY1w1dd9/YYcUymg0U=; b=JPFmn/6NJoXTTe52dDrDGZwRk17txRN06jnQfOkAasowVy9PWa0qmsc0emipjuq2IDTgjg fgYXWEVPoSCFyOn3ATYAtevOOThVXEPy4Xw0K8m6kVr9RvopKU85jLLCqESjv2g+9ZQxTL MPJcNl3TiWJxght2lbGdlFmi+WFviJ4ucz7kJfBe+wJIJXHPtOx+q3WAO16mJFOkkoYNBK yFAj/Wocje4cdLMAlSj10dcZKq2pfN8Mc9xZFUu3DQpzocwasfjgd4kpp/W23Fo5WJxd44 Tm3auYk+oaymukK6d38n8qV1U5J0m5EcGcIVe1tveZYgHISr5R1Dp+C2g+jYBg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=M4j8CLbP; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698470631; a=rsa-sha256; cv=none; b=pencKYNSTTk6gswu2F8we/UIf+lyOSGc7izU9oSHFRkuGHqS+F6KXJIcE1Zyi0zsWEi2th 4vIxpVFDnUITjXeSq3RBqCbFgnEi7M1BmgTRhR9ec4SgUE9ZFFJJB6ShKpUMcfRY9crv5B qHNiUpail2I+mUNn80BFyyTKEu0LQ1W5r0r87aI6icVr3DophTW2zVyD8/kd4ASUCLZ/uO OOo8LdDVuni+SfK41ggMzBvm38X4TxsahjvZkbqLBze2yjiGdUTE8/eY391Cr0bSvN/hAN wJx/mxxuHdZWpZHulXpeiRRTGJkCwhN6w/GpP+iD+G3p7DIiUa7wz5Dud0y/OA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwbmh-0001ug-3I; Sat, 28 Oct 2023 01:22:55 -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 1qwbmf-0001uK-6v for emacs-orgmode@gnu.org; Sat, 28 Oct 2023 01:22:53 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwbmd-0001dW-AG for emacs-orgmode@gnu.org; Sat, 28 Oct 2023 01:22:52 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c501bd6ff1so39504811fa.3 for ; Fri, 27 Oct 2023 22:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698470562; x=1699075362; darn=gnu.org; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=9pVkhs6NrtgMEV2lvNUNQagSbtY1w1dd9/YYcUymg0U=; b=M4j8CLbPdguFJlyKAfJvbUsjVYbsZEuLStMFHNA4hyu5ril0p7wQ5+9c/JklYio+LI 4NnOi2EH3MYwcXjhBnpXpkEJsrxX3+9lU75fivjYfiOZf2T3vI0VFQ2R7cqrmcbWTY9D zGtwTUg1jsROiTdKVddtRq9o6Gz7h/TrJphkSfbqDqhAzg8MECAakGAopeRpaQOmsMKw Ii5cldIOLF72VOqVFt/uUxeR5G5P4ZYCmnQTht79o+TuWgWkEch1wpLbF8k3rfu60jUj 3ZvtPKojhMVdngMJt1TMS7iEHMnkaBEi0HOZ4clIa2d5+ZvERQmhnynqs01F4P19rROx q6cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698470562; x=1699075362; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9pVkhs6NrtgMEV2lvNUNQagSbtY1w1dd9/YYcUymg0U=; b=bLe+wvgD+zeP+6Z4meda0lIA6thzUAGWN5ASyOo1bSkDfL4DCzud9x93FzwuvEnPEO VlVzvKYUbdG64sXwujWSp+S/8KEB0yBTVw2keP6YizDQa8YZho9Dt9fr9xWgHEDLJYWV GesmGwGCPdazTLYFIWcA9HVL1rH/+PKIAoDRqkwN+LAG035pspBW16QusiihrNCRpjsq cxU6mHlaXS8LnShheGoOAl5mEgYFr7wxHL9lSUuWbL5hO2pZcUWDl+NWNEzPkZz+8cax jrGkXSl7njVjTCbgLOZLQE3D/LVcSYsRJIiy+BdCN3c+LO+i+aRryc+mIpEmbzk4kmQA Zv1Q== X-Gm-Message-State: AOJu0YzCWJEjKMgh4+VDzYcOV0rpiP6YSYJcBjrJYkW72WtwsEkKC5Lg ZCDbW+6YGANWrdl/Bz8SVoE= X-Google-Smtp-Source: AGHT+IETqIRcygpAqERRb4U6fX8aM62pG5912eO24v6MszsSGtBFze0eZrx3/O2X9bqngt3Jh7iDxg== X-Received: by 2002:a2e:828a:0:b0:2c5:1ef4:6e15 with SMTP id y10-20020a2e828a000000b002c51ef46e15mr3344625ljg.38.1698470561729; Fri, 27 Oct 2023 22:22:41 -0700 (PDT) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id e20-20020a2e8ed4000000b002bfe8537f37sm519190ljl.33.2023.10.27.22.22.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Oct 2023 22:22:41 -0700 (PDT) Message-ID: Date: Sat, 28 Oct 2023 12:22:39 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bash source code block: problem after ssh commands Content-Language: en-US, ru-RU To: alain.cochard@unistra.fr Cc: Leo Butler , "emacs-orgmode@gnu.org" 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> From: Max Nikulin Mail-Followup-To: alain.cochard@unistra.fr, Leo Butler , "emacs-orgmode@gnu.org" In-Reply-To: <25916.238.191509.652552@gargle.gargle.HOWL> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=manikulin@gmail.com; helo=mail-lj1-x236.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 2.91 X-Spam-Score: 2.91 X-Migadu-Queue-Id: 30F0F55CA2 X-Migadu-Scanner: mx13.migadu.com X-TUID: Vwm/7grEvgVP On 28/10/2023 01:26, Alain.Cochard@unistra.fr wrote: > 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 Without quotes it means: execute shell script (just "bash" this case) with "$0" set to "/path/to/file-containing-the-source-code.sh". "/path/..." is ignored because shell script does not contain "$0". It is a way to safely pass arguments to shell, however "$0" is confusing: sh -c 'echo "arg0: $0"; echo args: "$@"' arg0 arg1 arg2 arg0: arg0 args: arg1 arg2 In this example "arg0: $0"; echo args: "$@"' has the same role as "bash" in the cited command. If you need to pass another variable into "sh -c" the use var="/bin/sh" sh -c 'ls -l "$1"' argv0-for-sh "$var" Unsafe variant ("var" contain quotes): sh -c "ls -l '$var'". The same warning is applicable to "emacs --eval "(func \"$var\")". > or, after making the script executable with 'chmod +x': > > /path/to/file-containing-the-source-code.sh Always add a shebang ("#!/bin/sh", "#!/bin/bash", etc.) to executable scripts. A chance to face a bug is a shell is higher when it is left up to the shell and the kernel what to do with files without shebangs. Sorry, I have not tried to debug the original issue.