From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add shell-quasiquote. Date: Wed, 21 Oct 2015 20:11:38 +0200 Message-ID: <87si54xfad.fsf@fencepost.gnu.org> References: <87si59wj42.fsf@T420.taylan> <87mvvfm0bd.fsf@T420.taylan> <56250803.5080601@cs.ucla.edu> <87a8ren5ys.fsf@T420.taylan> <56259BB1.3070908@cs.ucla.edu> <878u6ykmvt.fsf@T420.taylan> <87h9llvo98.fsf@members.fsf.org> <5626622A.3090707@yandex.ru> <87zizdijbp.fsf@T420.taylan> <56267302.7050606@yandex.ru> <87io61igyu.fsf@T420.taylan> <56267CDF.6010201@yandex.ru> <87wpuhh15s.fsf@T420.taylan> <562683B9.1060305@yandex.ru> <83y4exe71v.fsf@gnu.org> <87y4ewoqbs.fsf@fastmail.com> <83si54e2qx.fsf@gnu.org> <87y4ew8fue.fsf@fastmail.com> <83zizcurco.fsf@gnu.org> <87k2qgw3q1.fsf@fastmail.com> <83lhawuny4.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445451491 17049 80.91.229.3 (21 Oct 2015 18:18:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Oct 2015 18:18:11 +0000 (UTC) Cc: Random832 , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 21 20:17:58 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZoxxV-0006qv-5Q for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 20:17:57 +0200 Original-Received: from localhost ([::1]:53388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoxxP-0006uz-Cx for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 14:17:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zoxs0-0004q2-FI for emacs-devel@gnu.org; Wed, 21 Oct 2015 14:12:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zoxrz-0003QT-CE for emacs-devel@gnu.org; Wed, 21 Oct 2015 14:12:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zoxrv-0003Oi-6X; Wed, 21 Oct 2015 14:12:11 -0400 Original-Received: from localhost ([127.0.0.1]:56675 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1Zoxru-0002wM-E2; Wed, 21 Oct 2015 14:12:10 -0400 Original-Received: by lola (Postfix, from userid 1000) id C12CADF4C3; Wed, 21 Oct 2015 20:11:38 +0200 (CEST) In-Reply-To: <83lhawuny4.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 21 Oct 2015 20:32:51 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192308 Archived-At: Eli Zaretskii writes: >> From: Random832 >> Date: Wed, 21 Oct 2015 13:06:46 -0400 >> >> Eli Zaretskii writes: >> >> From: Random832 >> >> It doesn't have a documented way for the caller to insist that the >> >> string be quoted for a POSIX shell rather than the user's shell. >> > >> > On what OS would that distinction be important, and why? >> >> Any OS which may have both a POSIX shell that a script may want to >> execute and a non-POSIX shell that is the user's shell. So basically all >> of them, especially if support for more non-POSIX shells such as csh, >> rc, scsh, fish, tclsh, is added in the future - or if a user's >> configuration supports them in the present by replacing or advising the >> function. > > First, do csh and the rest really non-Posix? I wonder. I always > understood "Posix shells" as a short for "any shell on a Posix host". I think it's more like "any shell trying to obey an (ex-)POSIX standard". Which would be and would not cover a csh. Users may set a different login and/or interactive shell. That's strictly speaking no longer "POSIX" if it does not try to be Bourne shell compatible in the main regards. > Is that incorrect? In what way are those "non-Posix"? Not trying to meet an (ex-)POSIX standard I think. >> It would mainly be useful in the presence of a broader mechanism, >> which doesn't exist yet, for executing POSIX shell scripts regardless >> of the user's interactive shell. > > On Posix hosts? I thought that was automatic, since each script says > what interpreter should run it in its "shebang" line. Right? Not necessarily. You can leave off the shebang line and scripts will be directly called by a fork (or something programmed to be equivalent) of your shell which might be more efficient than going through shebang. To avoid a csh executing a Bourne-only script, you can place a single : in the first line. That's a noop for a Bourne shell, and it tells csh and its ilk that it should not even try interpreting that script itself but rather leave that to /bin/sh or similar. These days, there are very few shell scripts _not_ started with a shebang line. But it's a definite possibility, even though then calling such scripts _not_ from a shell command line might fail. According to the man pages for GNU/Linux I have here, system(3) uses /bin/sh and should likely work whereas execve(2) requires the shebang line in order to pick an interpreter rather than loading a binary. Haven't tried this for a long time. -- David Kastrup