Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh 3.0.8 redirection bug



This appears to be a bug according to my (and Bash's) understanding
of redirection.  It isn't a known bug mentioned in the FAQ (2001/01/24).

Here is a short session log which shows the problem.

# /tmp% cat foo
# echo stdout
# echo stderr >&2
# /#tmp% ./foo
# stdout
# stderr
# /tmp% ./foo | nl
# stderr
#      1  stdout
# /tmp% ./foo 2>&1 | nl
#      1  stdout
#      2  stderr
# /tmp% ./foo 2>&1 >foo.out
# stderr
# /tmp% ./foo 2>&1 >foo.out | nl
#      1  stderr
#      2  stdout
# /tmp% cat foo.out
# stdout
# /tmp% exec /bin/bash
# [toby@means /tmp]$ ./foo 2>&1 >foo.out | nl
#      1  stderr
# [toby@means /tmp]$ exit

For some reason piping the output causes the original
standard output, which had been safely sent to a file,
to be re-animated.

Toby
-- 
Toby Kelsey     Software Engineer      Email  toby.kelsey@xxxxxxxxxx
Smartlogik,     BrightStation plc      Phone      +44 (0)1223 715069
The Westbrook Centre, Milton Road      Fax        +44 (0)1223 715001
Cambridge  CB4 1YG,            UK      Web     www.brightstation.com



Messages sorted by: Reverse Date, Date, Thread, Author