Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug with sh emulation; shouldn't KSH_TYPESET be set?



Felipe Contreras wrote:
> Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
[...]
>> So, I don't think it should be enabled.
>
> But it wouldn't hurt either, right? It would be nice to have some
> 'bash' emulation mode, but since there isn't any, why not enable this
> harmless option?

I'm unsure (personally, I wouldn't mind), as to whether the
argument-handling semantics of a random builtin can be changed with
POSIX in mind. Maybe someone with deeper understanding of the standard
can shed some light here.

I'd just do

    local foo="$(bar --baz)"

and be done with it. That should be portable over pretty much every
bourne-line shell that supports $(...) and `local',

>> 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.
>
> Hmm, I see, but there's no bash emulation mode =/
>
> I guess it's time to compare the differences between ksh and sh
> emulation to see which is closer.

Unsure, due to fairly limited knowledge of bash's extensions to POSIX.

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



Messages sorted by: Reverse Date, Date, Thread, Author