2017-05-24 16:15:03 +0200, Joerg Schilling:
> Stephane Chazelas <stephane.chaze...@gmail.com> wrote:
> 
> > If your "configure" script works with "mksh" but not with
> > "posh", I suspect it's because that script is using non-POSIX
> > ksh extensions, as basically mksh is pdksh with a few  fixes and
> > extensions added, while posh is pdksh with a few fixes and most
> > ksh extensions (over POSIX, not over Bourne) removed.
> 
> This is not true...
> 
> A configure script (if done correctly) is a script with _very_ 
> pessimistic assumptions on portability. Given that "posh" completely fails 
> here, makes it unusable for every day work.

Without being more specific than a script named "configure", I
can't really help. Even if you mean a GNU autoconf generated
"configure" script, that will still depend on whatever extra
"check" code snipets the developer has haded.

> > Note that AFAIK, posh's target is the Debian policy, not POSIX. Though
> > the Debian policy is for the most part a superset of POSIX (and
> > a few parts from Unix/XSI)
> 
> I have no idea what "posh" targets, but given that:
> 
> posh
> $ exit
> posh: exit: bad number

Let's be serious, if "posh" had such a bug it would have been
reported long ago and fixed. Presumably, you've compiled
it in a such way or on such a system that has never been tested
before and triggered a bug.

"exit" definitely works in the Debian package of "posh" (the
primary target system as its goal is to be a tool for Debian
developers to identify non-POSIX usages).

[...]
> > > bosh
> >
> > As discussed, as of the 2017-05-16 release, posh was not POSIX
> > and still had many of non-conformances of the Bourne shell.
> 
> "posh" has a 2017-05-16 release?

Sorry again. As I clarified in a later email, I meant "bosh",
not "posh".

[...]
> Back to zsh:
> 
> If there is no way to modify this command line:
> 
>       CONFIG_SHELL=/usr/bin/zsh  /usr/bin/zsh ./configure
> 
> in a way that allows to run the configure script, this is a bad
> state for the current usability of zsh. I currently need to do the
> following:
> 
>       cp /usr/bin/zsh /tmp
>       CONFIG_SHELL=/tmp/sh /tmp/sh ./configure
[...]

I don't see how that has anything to do with the usability of
zsh, but you can always add:

if [ -n "$ZSH_EMULATION" ]; then
  emulate "$ZSH_EMULATION"
fi

to your ~/.zshenv and run your "configure" script as:

  ZSH_EMULATION=sh CONFIG_SHELL=/usr/bin/zsh  /usr/bin/zsh ./configure

> > mksh, bash and yash at least have a "posix" option to enforce a
> > more compliant mode (at least bash enables it when invoked as
> > "sh"). See also the xpg_echo option in bash which you also need
> > to have a compliant echo.
> 
> There are a few features where the "Bourne Shell" would cause problems
> with existing Bourne Shell scripts if it was by default 100% POSIX.

Yes of course, POSIX is not backward compatible with the Bourne
shell, nobody denies that. The POSIX spec was never based on the
Bourne shell.

You cannot make a shell both Bourne compatible and POSIX
compatible at the same time.

> For this reason it implements set -o posix that is auto-activated if it was
> installed as /usr/xpg4/bin/sh (note that a symlink will not work here).
> 
> If you like to use the Bourne Shell as Linux default shell, compile it with:
[...]

As discussed, even with -o posix, in my tests it's still not
POSIX (for instance with regards to the environment processing,
with regards to redirected compound commands being run in
subshells, and $IFS processing at least).

-- 
Stephane

Reply via email to