Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: select problem
- X-seq: zsh-workers 26356
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Richard Hartmann <richih.mailinglist@xxxxxxxxx>
- Subject: Re: select problem
- Date: Sun, 18 Jan 2009 14:39:05 +0000
- Cc: david sowerby <d_sowerby@xxxxxxxxx>, zsh-workers@xxxxxxxxxx
- In-reply-to: <2d460de70901170321g66b892dei2a4e5fac9c445db8@xxxxxxxxxxxxxx>
- Mail-followup-to: Richard Hartmann <richih.mailinglist@xxxxxxxxx>, david sowerby <d_sowerby@xxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <234804.32891.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20090117092515.GA5400@xxxxxxxxxxxxxxx> <2d460de70901170321g66b892dei2a4e5fac9c445db8@xxxxxxxxxxxxxx>
On Sat, Jan 17, 2009 at 12:21:31PM +0100, Richard Hartmann wrote:
> On Sat, Jan 17, 2009 at 10:25, Stephane Chazelas
> <Stephane_Chazelas@xxxxxxxx> wrote:
>
> > "select" is not standard (that is not in the POSIX sh, which
> > is the only standard you can expect both bash and zsh to conform
> > to (when called as "sh")) and is a kshism. It's also rather
> > useless as one can do the same thing easily without.
>
> zsh is not fully POSIX compliant and afaik, there are no plans to
> ever make it that way, either. While zsh and POSIX agree most
> of the time, using zsh as your sh _will_ get you strange effects.
>
> I don't have time to dig up more, but look at [1] and [2] for some
> examples.
[...]
None of the so called POSIX shells are fully conformant. AFAIK,
only AT&T ksh claims to be fully conformant. bash follows the
GNU or LSB standards when they conflict with POSIX (see for
instance echo -e that doesn't output -e). ash derivatives still
have some way to go. But all try to be as conformant as
reasonable (so long as their design choices allow and as long as
implementing a POSIX feature wouln't break backward
compatibility).
For instance, I've never come accross a shell implementation
that implements that (rather stupid IMO) POSIX feature that says
that: "PATH=; echo test" should output "echo: command not
found" (that is a built-in should only be invoked if a command
by that name is found in $PATH).
Still, I can't think of how a script could be reasonably made to
rely on that behavior, which is why it's not a problem that all
shells break POSIX conformance there, in a same way that running
a POSIX script with zsh (in sh emulation) generally isn't a
problem because it's only in corner cases that zsh is not
conformant. When a POSIX conformance issue is found by someone,
it is generally raised on this mailing list and most of the time
fixed (at least in sh emulation).
Having said that, I agree there's no much point of having zsh as
your POSIX sh.
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author