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

Re: [PATCH] typeset: set $? on incidental error



Between all the replies I'm convinced that the builtin interface of
'local' shouldn't be changed: «builtin local x=$(false)» should set $?
to 0.  (I meant to say that in a previous email.)

However, the question remains, in my eyes, whether the change should be
made to the reserved word interface.  The reserved word 'typeset' is not
a command, but part of the shell's language, so in
.
    typeset x=$(foo) y=$(bar)
.
the last command executed is 'bar'.  I would expect that line to behave
as similarly to
.
    x=$(foo) y=$(bar)
.
as possible, so for example, I'd expect the former to set $? to the exit
code of 'bar', as the latter statement does.

Cheers,

Daniel



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