GNU bug report logs - #11246
Is this a bug in tee?

Previous Next

Package: coreutils;

Reported by: Adrian May <adrian.alexander.may <at> gmail.com>

Date: Sun, 15 Apr 2012 18:11:01 UTC

Severity: normal

Tags: notabug

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Alan Curry" <pacman-cu <at> kosh.dhis.org>
To: adrian.alexander.may <at> gmail.com (Adrian May)
Cc: 11246 <at> debbugs.gnu.org
Subject: bug#11246: Is this a bug in tee?
Date: Sun, 15 Apr 2012 17:39:47 -0500 (GMT+5)
Adrian May writes:
> 
> ad <at> pub:~/junk$ echo abcde | tee >(tr a 1) | tr b 2
> a2cde
> 12cde
> 
> I'd have expected 1bcde instead of 12cde. It seems like the tr b 2 is
> acting early on the stream going into tr a 2.
> 
> This is a ubuntu server 10.04 machine.
> 
> Adrian.
> 

The shell sets up the pipeline, and your shell is doing it stupidly. With
zsh, you'd get the correct result:

% echo abcde | tee >(tr a 1) | tr b 2
a2cde
1bcde

ksh and bash recently copied the process substitution feature from zsh, and
they haven't got it right yet.

-- 
Alan Curry




This bug report was last modified 13 years and 40 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.