zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: zsh-workers@math.gatech.edu (Zsh hacking and development)
Subject: Redirection bug
Date: Tue, 4 Jun 1996 00:45:18 +0200 (MET DST)	[thread overview]
Message-ID: <199606032245.AAA00255@hzoli.ppp.cs.elte.hu> (raw)

There is a feature which appeared after Zefram's redirection fixes:

% (echo bug >&2) >& /dev/tty >& /dev/null ; sleep 1
bug
bug

sleep 1 is not necessary above, but without sleep 1 the prompt comes back
while the tee process is still running which makes the output less
readable (that's really an other much older bug).

The problem above is the duplicated `bug'.  Considering that >& foo is the
> same as foo 2>&1, this produce the same output:

% (echo bug >&2) > /dev/tty 2>&1 > /dev/null 2>&1 ; sleep 1
bug
bug

Or swapping stderr and stdout:

% echo bug 2> /dev/tty >&2 > /dev/null >&2 ; sleep 1
bug
bug

And if we omit > /dev/null:

% echo bug 2> /dev/tty >&2 >&2 ; sleep 1
bug
bug

At this point this behavour seems to be correct.  bug is duplicated since
stdout is redirected twice.  Here bug was printed only once before
zsh-2.6-beta18.  That was probably a bug.  But now it is quite
counter-intuitive that >& /dev/tty >& /dev/null duplicates stderr on
/dev/tty.  I do not understand redirection staff in exec.c very much but I
do hope that Zefram knows some elegant solution to this problem.

Zoltan



             reply	other threads:[~1996-06-04  0:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-03 22:45 Zoltan Hidvegi [this message]
1996-06-05 14:17 ` Zefram

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=199606032245.AAA00255@hzoli.ppp.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=zsh-workers@math.gatech.edu \
    /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).