Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with sh emulation; shouldn't KSH_TYPESET be set?
- X-seq: zsh-workers 30160
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Subject: Re: Bug with sh emulation; shouldn't KSH_TYPESET be set?
- Date: Mon, 30 Jan 2012 21:43:49 +0100
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <CAMP44s1NhJXsT48qCHrpLGW2def_YcL1mXNWqu+ZD=oSBNFg4A@mail.gmail.com> (Felipe Contreras's message of "Mon, 30 Jan 2012 22:21:52 +0200")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAMP44s1NhJXsT48qCHrpLGW2def_YcL1mXNWqu+ZD=oSBNFg4A@mail.gmail.com>
Felipe Contreras wrote:
[...]
> local t=$(echo foo --bar)
[...]
> But not in zsh, with sh emulation. Enabling KSH_TYPESET makes it work.
>
> Shouldn't it be enabled with sh emulation?
>
> BTW. What exactly is 'emulate sh' supposed to emulate? I would like to
> run that shell to check for compatibility issues, and apparently it's
> not bash.
"emulate sh" is POSIX shell emulation (we did amend this mode in the
past to work as much as possible as POSIX describes). Neither typeset
nor local are part of POSIX (at least not SUSv3 - I don't know about
v4).
So, I don't think it should be enabled.
FWIW, dash and posh behave like zsh's sh-mode here. Ksh93 doesn't work
at all, because it has no `local' (only typeset). Mksh, pdksh and bash
work like KSH_TYPESET was set in zsh.
Regards, Frank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author