Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Re: exit value of intermediate program in pipe

On Sat, May 02, 1998 at 07:08:31PM -0700, Bart Schaefer wrote:
> You can do this:
>     foo() {
>     	/bin/blah >>(grep -v "foo")
>     }
> That effectively runs grep in the background and blah in the foreground,
> while still connecting them with a pipe.  Then you get the exit status of
> blah, but with the side effect that the function returns as soon as blah
> finishes, without waiting for the grep -- which may not be what you want.

	isn't this what wait was designed for?

foo () {
   /bin/blah >>(grep -v "foo")

	what exactly is the syntax that >> uses to become a pipe
rather than a redirection to a file?  the way you describe it looks
a lot like a ksh two-way pipe, only cleaner; as i mentioned in my other
reply to this thread, i've never been able to get |& to work, so
any alternative would be welcome.

	-- sweth.

"Countin' on a remedy I've counted on before
Goin' with a cure that's never failed me
What you call the disease
I call the remedy"  -- The Mighty Mighty Bosstones

Messages sorted by: Reverse Date, Date, Thread, Author