zsh-users
 help / color / mirror / code / Atom feed
From: Meino Christian Cramer <Meino.Cramer@gmx.de>
To: schaefer@brasslantern.com
Cc: zsh-users@sunsite.dk
Subject: Re: Is this possible with MULTIOS
Date: Mon, 23 Oct 2006 06:41:23 +0200 (CEST)	[thread overview]
Message-ID: <20061023.064123.74746266.Meino.Cramer@gmx.de> (raw)
In-Reply-To: <061022193054.ZM16624@torch.brasslantern.com>

From: Bart Schaefer <schaefer@brasslantern.com>
Subject: Re: Is this possible with MULTIOS
Date: Sun, 22 Oct 2006 19:30:54 -0700

> 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
> 

Hi Bart,

 *thanks a lot* :)

 Both solutions will help me !

 Have a nice week!
 mncc


 


      reply	other threads:[~2006-10-23  4:41 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
2006-10-23  4:41   ` Meino Christian Cramer [this message]

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=20061023.064123.74746266.Meino.Cramer@gmx.de \
    --to=meino.cramer@gmx.de \
    --cc=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).