I found a redirection bug in bash 2.05b. I didn't see anything
similar searching gnu.bash.bug, so I think this is new.
Bash 2.05b fails with a bad file descriptor message when attempting
certain complicated redirections. In the example below I am trying
to tee stderr while also passing stderr to stdout.
This seems to be fixed in 3.00, so I'm not sure how interested
anyone will be. It's inconvenient for me because I have broken
scripts after upgrading to RH Enterprise Linux 3, which comes with
bash 2.05b.
- Fritz
### OK in bash 2.03 on SPARC Solaris
#
tigger $ uname -a
SunOS tigger 5.6 Generic_105181-05 sun4u sparc SUNW,Ultra-30
tigger $ echo $BASH_VERSION
2.03.0(1)-release
tigger $ ( ( ( echo OUT ; echo ERR >&2 ) 2>&1 >&3 ) | tee /tmp/x.err ) 3>&1
OUT
ERR
### OK in bash 2.04 on SPARC Solaris
#
rabbit $ uname -a
SunOS rabbit 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-30
rabbit $ echo $BASH_VERSION
2.04.0(1)-release
rabbit $ ( ( ( echo OUT ; echo ERR >&2 ) 2>&1 >&3 ) | tee /tmp/x.err ) 3>&1
OUT
ERR
### BUG in bash 2.05b on x86_64 Red Hat Enterprise Linux 3
# (also on 32-bit x86, not shown)
#
# Need to enclose in ( ) and add : command to get correct behavior
#
simba $ uname -a
Linux simba 2.4.21-32.0.1.EL #1 SMP Tue May 17 17:52:26 EDT 2005 x86_64
x86_64 x86_64 GNU/Linux
simba $ echo $BASH_VERSION
2.05b.0(1)-release
simba $ ( ( ( echo OUT ; echo ERR >&2 ) 2>&1 >&3 ) | tee /tmp/x.err ) 3>&1
bash: 3: Bad file descriptor
simba $ ( ( ( ( echo OUT ; echo ERR >&2 ) 2>&1 >&3 ) | tee /tmp/x.err )
3>&1 )
bash: 3: Bad file descriptor
simba $ ( : ; ( ( ( echo OUT ; echo ERR >&2 ) 2>&1 >&3 ) | tee
/tmp/x.err ) 3>&1 )
OUT
ERR
### OK in bash 3.00 on x86 Mandriva 2005 Limited Edition
#
dotard $ uname -a
Linux dotard 2.6.11-6mdk #1 Tue Mar 22 16:04:32 CET 2005 i686 Pentium
III (Coppermine) unknown GNU/Linux
dotard $ echo $BASH_VERSION
3.00.16(2)-release
dotard $ ( ( ( echo OUT ; echo ERR >&2 ) 2>&1 >&3 ) | tee /tmp/x.err ) 3>&1
OUT
ERR
_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash