Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is this possible with MULTIOS
- X-seq: zsh-users 10893
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Is this possible with MULTIOS
- Date: Sun, 22 Oct 2006 19:30:54 -0700
- In-reply-to: <20061022.161634.41652125.Meino.Cramer@xxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20061022.161634.41652125.Meino.Cramer@xxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author