From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: execute shell scripts by call-process in msys2 environment Date: Wed, 12 Sep 2018 20:10:56 +0300 Message-ID: <83tvmuljz3.fsf@gnu.org> References: <83c503fb-eb42-46e0-a035-08a7879a2259@googlegroups.com> <6d64819d-1a0f-4dfe-bdf0-fa17df068bc7@googlegroups.com> <83y3c6lnl5.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1536772211 10305 195.159.176.226 (12 Sep 2018 17:10:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2018 17:10:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 12 19:10:07 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g08eV-0002ar-26 for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Sep 2018 19:10:07 +0200 Original-Received: from localhost ([::1]:37331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g08gb-0004dB-22 for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Sep 2018 13:12:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g08fR-0004bF-8I for help-gnu-emacs@gnu.org; Wed, 12 Sep 2018 13:11:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g08fO-0006vT-JS for help-gnu-emacs@gnu.org; Wed, 12 Sep 2018 13:11:05 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g08fO-0006vN-Cx for help-gnu-emacs@gnu.org; Wed, 12 Sep 2018 13:11:02 -0400 Original-Received: from [176.228.60.248] (port=3885 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g08fN-0000FR-OU for help-gnu-emacs@gnu.org; Wed, 12 Sep 2018 13:11:02 -0400 In-reply-to: (message from Andy Moreton on Wed, 12 Sep 2018 17:45:35 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117873 Archived-At: > From: Andy Moreton > Date: Wed, 12 Sep 2018 17:45:35 +0100 > > On MSYS2 "/usr/bin/ci" is a shell script that execs "rcs ci". This works > ok with `shell-command' as that shell can execute the script. Yes, MSYS2 moves more and more towards being just a variant of Cygwin in this regard: a large number of "ported" packages are available just as MSYS2 builds, which means you cannot easily run them from native apps. In this case, it should be trivial to provide a small batch file that invokes "rcs ci" exactly like the shell script does. Then native programs, including Emacs, will be able to invoke the batch file as if it were a program. Alas, the MSYS2 guys evidently don't think this to be important enough... > Other parts of emacs use `call-process' or `make-process', which expect > to run an executable directly, without invoking a shell. They can also > run shell scripts if the OS kernel execs the interpreter parsed from the > '#!' line in the script. MSYS2 (and Cygwin) run on Windows, which does > not do '#!' parsing in the kernel. FWIW, ye olde MSDOS port of Emacs is capable of running shell scripts, but "sic transit gloria mundi". > The following advice works for me on emacs 26 and later to fix this > problem on Cygwin (MSYS2 should be similar): I think it's much easier and safer to write a one-line batch file. Thanks.