From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10725 invoked from network); 1 Sep 2002 05:31:41 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 1 Sep 2002 05:31:41 -0000 Received: (qmail 9180 invoked by alias); 1 Sep 2002 05:31:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17596 Received: (qmail 9139 invoked from network); 1 Sep 2002 05:31:32 -0000 Message-ID: <20020901053129.61927.qmail@web20303.mail.yahoo.com> Date: Sun, 1 Sep 2002 15:31:29 +1000 (EST) From: =?iso-8859-1?q?Peter=20Bray?= Subject: Basic I/O redirection broken in ZSH 4.04/4.06 To: zsh-workers@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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