Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PRINT_EXIT_VALUE: Suppress for if/while conditions
- X-seq: zsh-workers 36179
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: PRINT_EXIT_VALUE: Suppress for if/while conditions
- Date: Sat, 15 Aug 2015 03:20:35 +0200
- 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==
- In-reply-to: <20150815010451.GA16635@ioooi.vinc17.net>
- 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: <20150731231225.GB2054@tarsus.local2> <20150815010451.GA16635@ioooi.vinc17.net>
On Sat, Aug 15, 2015 at 3:04 AM, Vincent Lefevre <vincent@xxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author