From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6578 invoked by alias); 15 Aug 2015 01:20:38 -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: 36179 Received: (qmail 26594 invoked from network); 15 Aug 2015 01:20:37 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.0 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 :content-type; bh=Y20MPodlNLV9TBOLb0YwtQhk4dberQBtJ7RuAogmUNc=; b=H8NbjRaIDeV5CbpcvspTG+xYwTgjnG3ukKUnnPkkQ17FeArEg3xbteIByS3PUmRHcZ 9k+0oqR6OkUBj0TM4EGslgEsPg1osUiP30XQbSHDoS1hjvu64vfym6hy1D2Mc50KKCAt /rL9Z+mfWv6bfXnl/kg15RyyD7zJQwkQMhJUU/PuyqXlXSsBnWiOr7vIIRIm1blWCRde ZaOoJkCV7DczWGmGYZlJhr26aa2aOb6CcOVKTuXVK4v9fYam19Ea0iHDC1A/gt1hOLJ9 CxP76Dde/sS5sVXD5txqnB6cyWtXEYqM1dyCkEohsv6p0ll9nrHtE3pmOEOpCLh9WAEd 6osA== MIME-Version: 1.0 X-Received: by 10.107.31.134 with SMTP id f128mr43523003iof.19.1439601635149; Fri, 14 Aug 2015 18:20:35 -0700 (PDT) In-Reply-To: <20150815010451.GA16635@ioooi.vinc17.net> References: <20150731231225.GB2054@tarsus.local2> <20150815010451.GA16635@ioooi.vinc17.net> Date: Sat, 15 Aug 2015 03:20:35 +0200 Message-ID: Subject: Re: PRINT_EXIT_VALUE: Suppress for if/while conditions From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 On Sat, Aug 15, 2015 at 3:04 AM, Vincent Lefevre wrote: > On 2015-07-31 23:12:25 +0000, Daniel Shahaf wrote: >> I'd like to disable the effect of PRINT_EXIT_VALUE while evaluating >> if/while conditions, since it's uninformative (conditions sometimes >> fail, that's their sine qua non) and annoying (when doing a for/if >> interactively and the 'if' condition is false in many iterations, the >> option must be disabled to prevent stderr spamming). > > It's also annoying in loops, e.g. > > for i in **/*.gz; zgrep foo $i Seeing the exit value of each zgrep invocation seems to be within the scope of the option. If you find it annoying, maybe you shouldn't have it set? For example if you did for i in file1 file2; do veryimportanttask $i done you would surely want to see if any of the invocations failed. I could see the value in making it shut up if you changed the body to for i in file{1..9999}; do notsoimportanttask $i || : done but that doesn't currently help. -- Mikael Magnusson