zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: PRINT_EXIT_VALUE: Suppress for if/while conditions
Date: Sat, 15 Aug 2015 03:20:35 +0200	[thread overview]
Message-ID: <CAHYJk3TB=M=X2PSa2Jx0s2jwkVk9aCy8NqVarX8184HS0s4CFg@mail.gmail.com> (raw)
In-Reply-To: <20150815010451.GA16635@ioooi.vinc17.net>

On Sat, Aug 15, 2015 at 3:04 AM, Vincent Lefevre <vincent@vinc17.net> 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


  reply	other threads:[~2015-08-15  1:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 23:12 Daniel Shahaf
2015-08-13  8:32 ` Peter Stephenson
2015-08-13 23:20   ` Daniel Shahaf
2015-08-14  8:19     ` Peter Stephenson
2015-08-17 22:00       ` Daniel Shahaf
2015-08-15  1:04 ` Vincent Lefevre
2015-08-15  1:20   ` Mikael Magnusson [this message]
2015-08-19  0:06     ` Vincent Lefevre
2015-08-19  0:25       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3TB=M=X2PSa2Jx0s2jwkVk9aCy8NqVarX8184HS0s4CFg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).