Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: zsh-4.2.1: unset does not follow spec
- X-seq: zsh-workers 20407
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: zsh-4.2.1: unset does not follow spec
- Date: Thu, 23 Sep 2004 09:14:41 -0700 (PDT)
- In-reply-to: <23277.1095931599@xxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20040922091323.V45751@xxxxxxxxxxxxxxx> <Pine.LNX.4.61.0409220822040.16822@xxxxxxxxxxxxxxxxxx> <20040922205546.1fb37a99@xxxxxxxxxxxxxxxxxxxxx> <Pine.LNX.4.61.0409230039020.21324@xxxxxxxxxxxxxxxxxx> <23277.1095931599@xxxxxxxxxxxxxxxxxxxxx>
- Reply-to: zsh-workers@xxxxxxxxxx
On Thu, 23 Sep 2004, Oliver Kiddle wrote:
> The specification looks fairly clear to me (zsh is wrong)
On Thu, 23 Sep 2004, Geoff Clare wrote:
>
> I would say that a non-zero exit for "unset" is definitely an error, but
> the standard is unclear as to whether "unset" is required to treat an
> attempt to unset a variable that was not previously set as an ordinary
> error (as opposed to a "utility syntax error", which is definitely not
> allowed).
>
> --
> Geoff Clare, opengroup.org
I don't really have a strong opinion either way (I can't remember EVER
testing the exit status of "unset" but I suppose it could affect the
shell in the case of "setopt errexit"), but I don't think it's as cut
and dried as it should be.
(Back to Oliver)
On Thu, 23 Sep 2004, Oliver Kiddle wrote:
>
> > (Is it time for "emulate posix"?)
>
> Possibly.
>
> How would it differ from "emulate sh"?
At the moment, it might not. If, however, we were to discover a case
where POSIX specifies behavior that differs from historic /bin/sh
behavior, we might want a plain way to get either one.
Also, although "emulate" has so far been limited to setting options, it
might be worth considering whether it should also modify the environment,
e.g., exporting POSIXLY_CORRECT or UNIX95 or whatever. However, what it
exported would depend on compile-time configuration, which although it
could be OS-specific could not be architecture-specific, making trouble
on binary-compatible platforms that use different techniques to achieve
POSIX conformance. So, I'm not sure.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author