Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] typeset: set $? on incidental error
- X-seq: zsh-workers 37644
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] typeset: set $? on incidental error
- Date: Fri, 15 Jan 2016 15:46:09 +0100
- Cc: Eric Cook <llua@xxxxxxx>, zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VJZuxmqschDgyzMY+9+qdsm7cztz9KprFRKsq65RLRU=; b=lYJrFn8pZgpysVQS/qjvaMKyqUwY4SWjfPF0Z8Es5ojh6eyIQf//6X0M7VFdS1itZn nLlk5k3SEY8SH5vaWA/C60GtE15gYi55qetnoCHQcRAPNU9g+3dfwOOR01AQtbqp3u9p 7yHF9xfDqwdgsdet8tGiXEFxBfDF43uQHkP7yY2mrq0R8wikin1KJQGO93ZtVbhSgqf2 7MUBIKsa4l/Nc4GvRwX3n3WkKHGBia+1ChpxwygxlyAeB4wfIyo1nJLg7QuTmKTClvY/ JBi9GbT13T0QtPwlCV37oK+RumaeGdjeRI9es66UMk219jCEoPdh0utXHSD1x7Ut10gV /m1w==
- In-reply-to: <20160115062645.GB12223@tarsus.local2>
- 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: <20160114001336.GA11173@tarsus.local2> <56973114.90807@gmx.com> <20160115062645.GB12223@tarsus.local2>
On Fri, Jan 15, 2016 at 7:26 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Eric Cook wrote on Thu, Jan 14, 2016 at 00:24:36 -0500:
>> On 01/13/2016 07:13 PM, Daniel Shahaf wrote:
>> > The 'typeset' family of builtins doesn't set $? when one would expect it
>> > to do so:
>> >
>> > % x=$(true) y=$(exit 42); echo $?
>> > 42
>> > % local x=$(true) y=$(exit 42); echo $?
>> > 0
>> >
>> > This patch makes 'typeset' behave as ordiary assignment does.
>>
>>
>> But who expects that?
>
> I did.
local/typeset is a command, and it was successful, so I don't see why
$? should be set to anything else than 0.
% true x=$(false); echo $?
0
is technically exactly the same situation as your above second command.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author