From: "Peter Bray" <pdb_ml@yahoo.com.au>
To: zsh-workers@sunsite.dk
Subject: Basic I/O redirection broken in ZSH 4.04/4.06
Date: Sun, 1 Sep 2002 15:31:29 +1000 (EST) [thread overview]
Message-ID: <20020901053129.61927.qmail@web20303.mail.yahoo.com> (raw)
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
next reply other threads:[~2002-09-01 5:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-01 5:31 Peter Bray [this message]
2002-09-01 15:39 ` 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=20020901053129.61927.qmail@web20303.mail.yahoo.com \
--to=pdb_ml@yahoo.com.au \
--cc=zsh-workers@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).