zsh-users
 help / color / mirror / code / Atom feed
From: Erik Trulsson <ertr1013@student.uu.se>
To: zsh-users@sunsite.dk
Subject: Re: How to redirect stderr to a pipe and stdout to a file?
Date: Sun, 15 Jun 2003 16:04:10 +0200	[thread overview]
Message-ID: <20030615140409.GA66999@falcon.midgard.homeip.net> (raw)
In-Reply-To: <20030615125030.GA4042@s.chello.no>

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.
> I've looked through the chapter on redirection in zshmisc(1),
> but I couldn't find an answer.  (Of course, that doesn't mean
> it's not there. :-)
> 
> Thanks in advance for any help.

I don't know what the real answer is, but a workaround (which should
also work in bash) is to execute the first command in a subshell, i.e:

( ls INVALID . 2>&1 >/dev/null ) | less



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se


  reply	other threads:[~2003-06-15 14:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-15 12:50 Haakon Riiser
2003-06-15 14:04 ` Erik Trulsson [this message]
2003-06-15 16:11 ` Pavol Juhas
2003-06-15 17:43   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030615140409.GA66999@falcon.midgard.homeip.net \
    --to=ertr1013@student.uu.se \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).