From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7846 invoked from network); 3 May 1998 22:18:02 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 3 May 1998 22:18:02 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id SAA14548; Sun, 3 May 1998 18:13:57 -0400 (EDT) Resent-Date: Sun, 3 May 1998 18:13:34 -0400 (EDT) Message-ID: <19980503181509.09250@astaroth.nit.gwu.edu> Date: Sun, 3 May 1998 18:15:09 -0400 From: Sweth Chandramouli To: zsh-users@math.gatech.edu Subject: Re: Re: exit value of intermediate program in pipe Mail-Followup-To: zsh-users@math.gatech.edu References: <199805022224.QAA03113@ipecac.Central.Sun.COM> <980502190831.ZM29269@candle.brasslantern.com> <19980503021749.21621@astaroth.nit.gwu.edu> <980503023014.ZM31001@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89 In-Reply-To: <980503023014.ZM31001@candle.brasslantern.com> Resent-Message-ID: <"rhXbG2.0.oY3.EmEJr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1503 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Sun, May 03, 1998 at 02:30:14AM -0700, Bart Schaefer wrote: > That just means redirect both stdout and stderr as the pipe input. It is > a csh-ism, and not equivalent to the ksh syntax. See the FAQ. (I think > that means that you want the "coproc" builtin and <&p and >&p redirection > for setting up a "two-way pipe.") man, if i could just learn to rtfm... i saw that section a while ago in the man page, but since it was under "simple commands", i just skimmed it and moved on. even reading it carefully, though, i'm still not sure what the coproc syntax is. to recreate the function we're discussing with a two-way pipe (which would background one process so that the exit statuses could be separated), in ksh i would do { grep -v bar |& print -p `/bin/blah ; exitstatus=$?` read -p output echo $output return $exitstatus } or something like that. for zsh, would i just do { grep -v bar coproc | >&p `/bin/blah ; exitstatus=$?` <&p output ; echo $output return $exitstatus } ? (i'm not checking mail on a machine that i could test this on, or i would just go ahead and do so.) what zsh really needs is something like the hawksbill book from oreilly for ksh, that gives a lot of examples and compares it to other shells; i'm sure that half of my failures at zsh scripting come from trying to use ksh-isms that i assume are implemented. -- 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