From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17700 invoked by alias); 21 Jan 2016 14:22:06 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37719 Received: (qmail 2713 invoked from network); 21 Jan 2016 14:22:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_PCNT autolearn=no autolearn_force=no version=3.4.0 Date: Thu, 21 Jan 2016 15:22:01 +0100 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: [PATCH] typeset: set $? on incidental error Message-ID: <20160121142201.GD21104@cventin.lip.ens-lyon.fr> Mail-Followup-To: zsh-workers@zsh.org References: <20160114001336.GA11173@tarsus.local2> <56973114.90807@gmx.com> <20160115062645.GB12223@tarsus.local2> <20160118022557.GE3979@tarsus.local2> <20160120074752.GB29602@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160120074752.GB29602@tarsus.local2> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.24-6551-vl-r83103 (2016-01-05) On 2016-01-20 07:47:52 +0000, Daniel Shahaf wrote: > In real-life examples, if the command subst had a non-zero exit status, > the value would typically _not_ be the one I asked for: > > % cd $(mktemp -d) > % local mtime=$(zstat +mtime myfile) > zstat: myfile: no such file or directory This is not specific to "local". Same expected behavior with "printf": cventin% local mtime=$(zstat +mtime myfile) zsh: command not found: zstat cventin% echo $? 0 cventin% printf "%s\n" $(zstat +mtime myfile) zsh: command not found: zstat cventin% echo $? 0 -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)