zsh-workers
 help / color / mirror / code / Atom feed
* Redirection bug
@ 1996-06-03 22:45 Zoltan Hidvegi
  1996-06-05 14:17 ` Zefram
  0 siblings, 1 reply; 2+ messages in thread
From: Zoltan Hidvegi @ 1996-06-03 22:45 UTC (permalink / raw)
  To: Zsh hacking and development

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-06-05 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-03 22:45 Redirection bug Zoltan Hidvegi
1996-06-05 14:17 ` Zefram

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).