From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21322 invoked from network); 15 Jun 2003 16:11:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Jun 2003 16:11:55 -0000 Received: (qmail 2776 invoked by alias); 15 Jun 2003 16:11:44 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6166 Received: (qmail 2767 invoked from network); 15 Jun 2003 16:11:43 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 15 Jun 2003 16:11:43 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [158.130.12.194] by sunsite.dk (MessageWall 1.0.8) with SMTP; 15 Jun 2003 16:11:42 -0000 Received: from blue.seas.upenn.edu (BLUE.SEAS.UPENN.EDU [158.130.64.177]) by lion.seas.upenn.edu (8.12.9/8.12.8) with ESMTP id h5FGBfM1024019 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Sun, 15 Jun 2003 12:11:41 -0400 Received: from blue.seas.upenn.edu (localhost [127.0.0.1]) by blue.seas.upenn.edu (8.12.9/8.12.9) with ESMTP id h5FGBfOM024368 for ; Sun, 15 Jun 2003 12:11:41 -0400 (EDT) Received: (from juhas@localhost) by blue.seas.upenn.edu (8.12.9/8.12.9/Submit) id h5FGBf43024367 for zsh-users@sunsite.dk; Sun, 15 Jun 2003 12:11:41 -0400 (EDT) Date: Sun, 15 Jun 2003 12:11:41 -0400 From: Pavol Juhas To: zsh-users@sunsite.dk Subject: Re: How to redirect stderr to a pipe and stdout to a file? Message-ID: <20030615161141.GA23206@seas.upenn.edu> Mail-Followup-To: zsh-users@sunsite.dk References: <20030615125030.GA4042@s.chello.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030615125030.GA4042@s.chello.no> User-Agent: Mutt/1.4i On Sun, Jun 15, 2003 at 02:50:30PM +0200, Haakon Riiser wrote: > In bash, I could always do > > $ ls INVALID . 2>&1 >/dev/null | less > > to send stderr: > > ls: INVALID: No such file or directory > to the less buffer and stdout to /dev/null. When I use the > same command in zsh 4.0.6, _both_ stderr and stdout is sent > to less. If I remove "| less" from the command, it works as it > should: stdout is discarded and stderr is sent to the terminal. ... You need to setopt no_multios and the redirection would work as expected. For explanation see the MULTIOS section in zshmisc(1). HTH, Pavol