zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: Is this possible with MULTIOS
Date: Sun, 22 Oct 2006 19:30:54 -0700	[thread overview]
Message-ID: <061022193054.ZM16624@torch.brasslantern.com> (raw)
In-Reply-To: <20061022.161634.41652125.Meino.Cramer@gmx.de>

On Oct 22,  4:16pm, Meino Christian Cramer wrote:
} 
}  upcnt=`<update-cmd> | <filter> | wc -l`
}  if [ 0 -ne upcnt ]

If the filter is grep, it exits with a success code when it finds a
matching line or with failure when it does not, so you should be able
to do 

  if update-cmd | grep ...
  then recompile
  else ...
  fi

This would behave differently only if grep matched some lines and then
exited with an error.

However, to answer your literal question, yes, you can do this with
multios.  You just have to open an extra descriptor outside of the
subshell and redirect stdout to it inside the subshell.

  setopt multios
  uncnt=$(update-cmd | filter 1>&3 | wc -l) 3>&1


  reply	other threads:[~2006-10-23  2:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-22 14:16 Meino Christian Cramer
2006-10-23  2:30 ` Bart Schaefer [this message]
2006-10-23  4:41   ` Meino Christian Cramer

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=061022193054.ZM16624@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /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).