* Basic I/O redirection broken in ZSH 4.04/4.06
@ 2002-09-01 5:31 Peter Bray
2002-09-01 15:39 ` Bart Schaefer
0 siblings, 1 reply; 2+ messages in thread
From: Peter Bray @ 2002-09-01 5:31 UTC (permalink / raw)
To: zsh-workers
Greetings All,
Attached is a simple shell script which demostrates the issue I
discovered on the command line yesterday. The output from Solaris 8
(x86) is included for all bourne shell derived shells as well as
zsh-4.0.4 and zsh-4.0.6 (note also that Sun supplied 3.0.6 also has
this bug)
The bug involves ignoring the output of a command and simply using
stderr as the source for a pipe as in :
cmd 2>&1 >/dev/null | cmd
The problem is that zsh does not redirect stdout to /dev/null like
every other shell :-(
The script and example below fully demostrate the problem
Regards,
Peter Bray
Sydney, Australia
[software@porta] % cat zsh-redirect-bug
# Setup
testdir=/tmp/test.$$
mkdir ${testdir}
cd ${testdir}
touch file1
touch file2
ln -s somewhere1 symlink1
ln -s somewhere2 symlink2
# Test
ls -lL 2>&1 1>/dev/null | awk -F: '{print $1}'
# Cleanup
cd
rm -rf ${testdir}
[software@porta] % /pkgs/zsh-4.0.4/bin/zsh zsh-redirect-bug
./symlink1
./symlink2
total 0
-rw-r--r-- 1 software software 0 Sep 1 15
-rw-r--r-- 1 software software 0 Sep 1 15
[software@porta] % /pkgs/zsh-4.0.6/bin/zsh zsh-redirect-bug
./symlink1
./symlink2
total 0
-rw-r--r-- 1 software software 0 Sep 1 15
-rw-r--r-- 1 software software 0 Sep 1 15
[software@porta] % /bin/sh zsh-redirect-bug
./symlink1
./symlink2
[software@porta] % /bin/ksh zsh-redirect-bug
./symlink1
./symlink2
[software@porta] % /bin/bash zsh-redirect-bug
./symlink1
./symlink2
http://mobile.yahoo.com.au - Yahoo! Messenger for SMS
- Now send & receive IMs on your mobile via SMS
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-09-01 15:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-01 5:31 Basic I/O redirection broken in ZSH 4.04/4.06 Peter Bray
2002-09-01 15:39 ` Bart Schaefer
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).