From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17619 invoked from network); 23 Mar 2002 22:45:37 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Mar 2002 22:45:37 -0000 Received: (qmail 11814 invoked by alias); 23 Mar 2002 22:45:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16885 Received: (qmail 11803 invoked from network); 23 Mar 2002 22:45:25 -0000 From: "Bart Schaefer" Message-Id: <1020323224514.ZM29171@candle.brasslantern.com> Date: Sat, 23 Mar 2002 22:45:14 +0000 In-Reply-To: Comments: In reply to Wayne Davison "Piping stderr (was Re: Two bug reports)" (Mar 23, 1:18pm) References: X-Mailer: Z-Mail (5.0.0 30July97) To: Wayne Davison , Zsh hackers list Subject: Re: Piping stderr (was Re: Two bug reports) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 23, 1:18pm, Wayne Davison wrote: } } I'm wondering if it would be nice to create a syntax for piping just } stderr? You mean, other than `2>>(...)'? } We already have "|&" for piping both stdout and stderr Hmm. `|&' is short for `2>&1 |'. What would the new syntax be short for? The problem being that in order to pipe "just stderr" you have to dispose of stdout somehow. The proposed new syntax could be short for `2>&1 >&- |' but then you may get "bad file descriptor" because of the closed stdout. Or it could be short for `2>&1 >/dev/null |' except that in the case of MULTIOS that doesn't redirect stdout, it duplicates it to both /dev/null and the pipe; we'd at the least have to document as we do for `>&' that the effect of MULTIOS is subverted. Plus, some platforms don't have a /dev/null (zsh does compile for DOS, sort of). The same problem with MULTIOS occurs with `3>&2 2>&1 1>&3 |'. } What do you think about using "2|&"? Or maybe "2>|&" Of those, it'd have to be the latter, which is currently a parse error. The issue is really one of syntactic cleanliness; `|', `&', and `|&' are all command separators, whereas redirections such as `2>&1' are part of the command itself. That's why `2>&1 |' works differently than `2>&1 >'. The grammar gets a bit ugly if you make something that starts with a digit into a command separator. } Do any other shells have a syntax for this? Not that I know of. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net