emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add shell-quasiquote.


From: Stephen J. Turnbull
Subject: Re: [PATCH] Add shell-quasiquote.
Date: Thu, 22 Oct 2015 03:11:37 +0900

Eli Zaretskii writes:

 > First, do csh and the rest really non-Posix?  I wonder.

Yes.  There is a definition of the syntax of the sh language in the
POSIX standard, and csh and friends do not conform.  Bash and Zsh
don't conform exactly (eg, they provide extended globbing), but they
are nearly upward compatible with minimal sh.

 > I always understood "Posix shells" as a short for "any shell on a
 > Posix host".  Is that incorrect?  In what way are those
 > "non-Posix"?

The syntax of scripts is different from the language defined in POSIX.
csh uses C-like braces for grouping, where sh uses additional keywords
like "then" and "fi" to mark stanzas.  tclsh uses Tcl syntax, of
course.  And so on....

 > Next, I could see why users on a Posix host might want to execute
 > some commands with a particular non-default shell.  I don't see why
 > Emacs packages, perhaps with a sole exception of Tramp, would need
 > that.

Sometimes it pays to be precise.  All of the OS distributions gave up
on bash because it didn't quite conform to POSIX (even when invoked in
POSIX compatibility mode), and that caused bugs in package
installation and management for packages that used sh scripts rather
than perl or python.  That's why shells like ash and dash exist.

 > > 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?

No.  Unfortunately, there's a long history of systems (hel-lo, GNU!)
with /bin/sh linked to a non-conforming program.  Weeding out all the
bashisms in Debian package management scripts took quite a bit of pain
and effort.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]