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 30164
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Bug with sh emulation; shouldn't KSH_TYPESET be set?
- Date: Mon, 30 Jan 2012 23:20:44 +0100
- In-reply-to: <CAMP44s0Mji0OdU7K-ftazbwD2YYJzXzm1J1yEQOeWc0f2=zjMg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAMP44s1NhJXsT48qCHrpLGW2def_YcL1mXNWqu+ZD=oSBNFg4A@mail.gmail.com> <878vkoapkq.fsf@ft.bewatermyfriend.org> <CAMP44s0Mji0OdU7K-ftazbwD2YYJzXzm1J1yEQOeWc0f2=zjMg@mail.gmail.com>
On 2012-01-30 23:46:46 +0200, Felipe Contreras wrote:
> On Mon, Jan 30, 2012 at 10:43 PM, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> > 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.
>
> But it wouldn't hurt either, right?
Not sure. What if you have some executable named "local" in the path?
> It would be nice to have some 'bash' emulation mode, but since there
> isn't any, why not enable this harmless option?
Instead of changing options for sh emulation, why not add a 'bash'
emulation mode, even though it may not be perfect (it would be better
than sh anyway).
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author